Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with arcpy.da.updatecursor('TableName', ['FID', 'NewField'], sql_clause = ('None', 'Order By FID')) as uc:
- base = 40000
- counter = 10
- for row in uc:
- #Set the first value
- if row[0] == 1:
- row[1] = base
- #Set the value for odd rows
- elif row[0] % 2:
- row[1] = base - counter
- counter += 10
- #Only thing left is even rows
- else:
- row[1] = base + counter
- #commit the change
- uc.updateRow(row)
Add Comment
Please, Sign In to add comment