import arcpy table = 'some_table' last_val = None count = 0 cursor = sorted(arcpy.da.UpdateCursor(table, ['PASS_NUM', 'TPN'])) for row in cursor: if row[0] == last_val: row[1] = count elif row[0] != last_val: count += 1 row[1] = count last_val = row[0] else: pass cursor.updateRow(row)
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.