import arcpy from arcpy import env env.workspace = r"C:\temp\python\test.gdb" list = [] rows = arcpy.SearchCursor("Table") for row in rows: Class = row.getValue("Class") list.append(Class) del row, rows #remove duplicates from list list = dict.fromkeys(list) list = list.keys() for n in list: rec = 0 rows = arcpy.UpdateCursor("Table") for row in rows: if row.Class == n: pInterval = 1 if (rec == 0): rec = 1 row.SeqNumber = rec else: rec = rec + pInterval row.SeqNumber = rec rows.updateRow(row) del row, rows
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.