Guest User

Untitled

a guest
Mar 20th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. with arcpy.da.updatecursor('TableName', ['FID', 'NewField'], sql_clause = ('None', 'Order By FID')) as uc:
  2. base = 40000
  3. counter = 10
  4. for row in uc:
  5. #Set the first value
  6. if row[0] == 1:
  7. row[1] = base
  8. #Set the value for odd rows
  9. elif row[0] % 2:
  10. row[1] = base - counter
  11. counter += 10
  12. #Only thing left is even rows
  13. else:
  14. row[1] = base + counter
  15. #commit the change
  16. uc.updateRow(row)
Add Comment
Please, Sign In to add comment