import arcpy, random mylist = [] x = 1 while x <= 16: mylist.append(x) x += 1 rows = arcpy.UpdateCursor(r"C:\temp\python\test.gdb\Fires") for row in rows: y = random.choice(mylist) row.Random = y rows.updateRow(row) mylist.remove(y) del row, rows
def update(): import arcpy, random mylist = [] x = 1 while x <= 16: mylist.append(x) x += 1 x = 1 rows = arcpy.UpdateCursor(r"C:\temp\python\test.gdb\Fires") for row in rows: y = random.choice(mylist) row.Sample = y val = row.Sample mylist.remove(y) del row, rows return val
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.