NumPy proposes a way to get the index of the maximum value of an array via np.argmax.
np.argmax
I would like a similar thing, but returning the indexes of the
Use:
from operator import itemgetter from heapq import nlargest result = nlargest(N, enumerate(your_list), itemgetter(1))
Now the result list would contain N tuples (index, value) where value is maximized.
result
index
value