-3

enter image description hereenter image description here Why does this error occur? what could have gone wrong with my code? Code:

import csv,shapefile

csvfile="C:\Python27\Conv.csv"
f=open(csvfile,'rb')
reader=csv.reader(f)
shp=shapefile.Writer(shapefile.POINT)
shp.point(2,3)
shp.point(3,1)
shp.point(4,3)
name,id=[],[]
shp.field('Name')
shp.field('Id')
for i,row in enumerate(i):
shp.record(row[i])
shp.save("conv.shp")

closed as off-topic by user2856, HDunn, Midavalo Apr 26 '17 at 4:20

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    This is a duplicate of a question that you deleted: gis.stackexchange.com/questions/237422 To avoid the automated asking bans I strongly recommend that you fix rather delete any questions that the community asks you to improve. – PolyGeo Apr 20 '17 at 11:35
  • 1
    As a new user be sure to take the Tour. For questions that involve error messages we ask that you show us them in full using text rather than a picture so that they can be searched and also read easily on all devices. There is an edit button beneath your question which will enable you to do that and a {} button that enables you to format any highlighted text nicely. – PolyGeo Apr 20 '17 at 11:36
  • What is the error? – Midavalo Apr 26 '17 at 4:19
  • Indentation error. Resolved. But I am unable to find the saved shapefile in C drive. – Sowmya Rajendran Apr 26 '17 at 13:53
3

Your last two lines need to be indented:

for i,row in enumerate(i):
    shp.record(row[i])
    shp.save("conv.shp")

PEP 8 convention is to indent using four spaces

  • Still the same error exists after pressing Enter. I get an error like 'int' object is not iterable – Sowmya Rajendran Apr 20 '17 at 14:16
  • 1
    That is not the same error so you need to research, and if necessary ask, about it as a new question. – PolyGeo Apr 20 '17 at 19:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.