Getting indices of ascending order of list

后端 未结 2 839
忘掉有多难
忘掉有多难 2021-01-16 13:33

I know that this question has been asked a hundred times, but the answer always seems to be \"use numpy\'s argsort\". But either I am misinterpreting what most people are as

2条回答
  •  误落风尘
    2021-01-16 14:01

    The reason why you are not getting the 'right,' or expected, answer is because you are asking the wrong question!

    What you are after is the element rank after sort while Numpy's argsort() returns the sorted index list, as documented!. These are not the same thing (as you found out ;) )!

提交回复
热议问题