Created
December 4, 2015 06:22
-
-
Save cindygis/ac1eb4b57f3469109ba2 to your computer and use it in GitHub Desktop.
Updates a field using a nested loop in an arcpy update cursor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import arcpy | |
lyr = arcpy.mapping.Layer(r'C:\Some\Arb\Folder\work.gdb\ftr_test') | |
cursor = arcpy.da.UpdateCursor(lyr, 'Name') | |
for i in xrange(10): | |
for e in ['X', 'Y']: | |
upd.next() # Increment the cursor | |
upd.updateRow(['Zone ' + str(i) + e]) | |
# Output | |
# Zone 1X | |
# Zone 1Y | |
# Zone 2X | |
# etc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment