Skip to content

Instantly share code, notes, and snippets.

@maptastik
Created February 20, 2019 16:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maptastik/f91342bf0a70a1cf71488614c5c4adbe to your computer and use it in GitHub Desktop.
Save maptastik/f91342bf0a70a1cf71488614c5c4adbe to your computer and use it in GitHub Desktop.
# max = max FACILITYID value in dataset. This can be calculated with a function
with arcpy.da.UpdateCursor('feature_class', ['FACILITYID'], "FACILITYID IS NULL") as cursor:
for row in cursor:
new_facilityid_number = max + 1
row[0] = str(new_facilityid_number)
max = new_facilityid_number
cursor.updateRow(row)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment