import arcpy FC = "C:\\YourFeatureClass" SORT_FIELD = "F1" F2 = 1 # Create update cursor to populate F2 rows = arcpy.UpdateCursor(FC,"","",SORT_FIELD, SORT_FIELD + " A") # Sort FC ASCENDING on F1 field currentstate = "" for row in rows: # Loop if currentstate != row.SORT_FIELD: currentstate = row.SORT_FIELD row.F2 = F2 rows.updateRow(row) # Populate F2 F2 += 1 del row, rows # Delete to clear locks
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.