One way to solve this would be to use a sql clause in a arcpy.da.SearchCursor
to sort your values in descending order. Then you would store the third value of the sorted column. The trick is that you only want to get the third highest so you can utilize a counter variable. Without testing the code something like this could get the job done:
searchFields = ‘AveragePrice’
query = ‘AveragePrice’
sqlClause = (None, ‘ORDER BY ‘ + query + ‘ DESC’)
ct = 0
with arcpy.da.SearchCursor(fc, field_names = searchFields, sql_clause = sqlClause) as searchCursor:
for row in searchCursor:
if ct == 3:
break
elif ct == 2:
thirdHighestPrice = row[0]
else:
ct += 1
continue
Then feed that value of thirdHighestPrice into a arcpy.SelectLayerByAttribute_management
statement to select all values that are greater than or equal to the variable thirdHighestPrice.