My question is very similar to this one: How to get indices of N maximum values in a numpy array?
But I would like to get the indices in the same order I find them.
Let's take the example marked in that question as the correct solution:
import numpy as nparr = np.array([1, 3, 2, 4, 5])arr.argsort()[-3:][::-1]array([4, 3, 1])
The result I'm looking for instead should be like:
array([1, 3, 4])