I tried the following code:
import numpy
s = [6,6,6,6,6]
print(numpy.argsort(s))
Output:
[0 1 2 3 4]
Expected Output: [4 3 2 1 0]
Another example sample code:
s = [5, 5, 2, 2, 3]
li = []
for i in range(len(s)):
li.append([s[i], i])
li.sort()
sort_index = []
for x in li:
sort_index.append(x[1])
print(sort_index)
Output:
[2, 3, 4, 0, 1]
Expected Output:
[3 2 4 1 0]
Could this unstable sort index return is possible in python?