myField = "MY_FIELD" minValue = arcpy.SearchCursor(inlayer, "", "", "", myField + " A").next().getValue(myField) #Get 1st row in ascending cursor sort maxValue = arcpy.SearchCursor(inlayer, "", "", "", myField + " D").next().getValue(myField) #Get 1st row in descending cursor sort
theitems = [] rows = arcpy.SearchCursor(inlayer) for row in rows: theitems.append(row.getValue(somefieldname)) del rows theitems.sort() min = theitems[0] max = theitems[-1]
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.