The argsort
function of numpy returns the original index of the sorted list.
Now I want the index of the sorted list for the original list. Is there
a function or an elegant way to do this ?
For example:
>>> import numpy as np
>>> a = np.array([2, 8 , 5, 6])
>>> np.argsort(a)
array([0, 2, 3, 1])
>>> function(a)
array([0, 3, 1, 2])