I am trying to convert cursors written in 10.0 to use the new arcpy.da module in 10.2.1. If I step through the code in debug mode, it steps into the for loop; however, when I attempt to run the code I get an exception : iteration not started
code for 10.0
for row in updateCursor:
if row.getValue("STREET_NUMBER_PREFIX") in ['N', 'S', 'W']:
row.setValue("STREET_DIR_PREFIX", row.getValue("STREET_NUMBER_PREFIX"))
row.setValue("STREET_NUMBER_PREFIX", None)
code for 10.2.1
with arcpy.da.UpdateCursor(civicAddress, flds) as rows:
for row in rows:
if row[0] in ['N', 'S', 'W']:
row[1] = row[0]
row[0] = None
What can I do to solve my problem? I have quite a few code blocks as above that deal with specific logic cases. Many thanks
Aucun commentaire:
Enregistrer un commentaire