I have the following piece of code in python:
results = {}
....
results = sorted([(v, k) for (k, v) in results.items()])
....
return results[:limit]
results
contains distances that are sorted in such a way the smaller distances are in the top of the list
Is there a way to sort this list in such a way the higher distances are in the top of results
?
Or, if we don't reverse the items is there a way to get the last items of results
instead of the top results using return results[:limit]