heapq.nlargest in Processing
in
Core Library Questions
•
1 year ago
There is a nice function called heapq.nlargest in python
Is there something like that in processing?heapq.nlargest(n, iterable[, key])
Return a list with the n largest elements from the dataset defined by iterable. key, if provided, specifies a function of one argument that is used to extract a comparison key from each element in the iterable: key=str.lower Equivalent to: sorted(iterable, key=key, reverse=True)[:n]
1