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
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.