Advertisement
Guest User

Untitled

a guest
Apr 1st, 2015
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. import arcpy
  2.  
  3. fc = r'C:pathtoyourfc'
  4.  
  5. startNumber = 51
  6.  
  7. with arcpy.da.UpdateCursor(fc, "myField") as cursor:
  8. for row in cursor:
  9. row[0] = startNumber
  10. startNumber = startNumber + 1
  11. cursor.updateRow(row)
  12.  
  13. import arcpy
  14.  
  15. fc = r'C:pathtoyourfc'
  16.  
  17. startNumber = 51
  18. endNumber = 75
  19.  
  20. with arcpy.da.UpdateCursor(fc, "myField") as cursor:
  21. for row in cursor:
  22. if startNumber <= endNumber:
  23. row[0] = startNumber
  24. startNumber = startNumber + 1
  25. cursor.updateRow(row)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement