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
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.