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]
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.