SyntaxFix
Write A Post
Hire A Developer
Questions
you can use numpy.argsort
numpy.argsort
or you can do:
test = [2,3,1,4,5] idxs = list(zip(*sorted([(val, i) for i, val in enumerate(test)])))[1]
zip will rearange the list so that the first element is test and the second is the idxs.
zip
test
idxs