Find Max Value and next highest two in Column using ArcPy?

المشرف العام

Administrator
طاقم الإدارة
I have a piece of code where I am able to find the max value. How can i edit this code to find the second largest, and then the third? I found this code here (https://geonet.esri.com/message/237880#237880). While there is another method that identifies a way to do this, it appears like it would be much slower (bulid array, sort, and pull [-1])

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

أكثر...
 
أعلى