I have an arcpy data access update cursor that I would like to sort before making updates to. The cursor makes updates if I don't sort but if I add a sort to the cursor I get an error, "iteration not started."
The sort is working correctly but it must be busting the cursor for some reason.
Is it not possible to sort an update cursor like a search cursor? Does it change the type or something?
idList = ['100100', '100200', '100300', 200100'] count = 0 with arcpy.da.UpdateCursor(newFC, ("SHAPE@X", "SHAPE@Y", "Label")) as addLabelCursor: for row in sorted(addLabelCursor, key=itemgetter(0), reverse = True): print idList[count] row = str(idList[count]) addLabelCursor.updateRow(row) count += 1