For example, I have a numpy array like: a = np.array([0.5, 0.1, 0.5)].
When I use np.argsort(a)[::-1] to sort my array in descending order, it returns:
2, 0, 1
Which is technically correct, as np.argsort(a) would return:
1, 0, 2
and I am just reversing the order.
However, I want the sort to be in the order as the original array, so I would like the return to be:
0, 2, 1
How do I do that? Is there a better function than np.argsort()?