Say I have array:
A = [3, 3, 2, 2, 4]
The indices of the sorted list (ascending) would be:
[2, 3, 0, 1, 4]
I want the reverse sorted list (descending):
[4, 0, 1, 2, 3]
Note that the reverse sorted list is not a direct reverse of the sorted list.
I would have used numpy; however, if I do this:
indices = np.argsort(A)[::-1]
# This gives: indices = [4, 1, 0, 3, 2]
# But I want: indices = [4, 0, 1, 2, 3]
Thus, how do I get the indices of the reverse sorted list that I want? Or is there some way to do this with numpy?
Thanks!