先对数组从小到大排序再返回对应的下标
from numpy import argsort, array a = array([4, 1, 3, 2]) print(argsort(a)) """output [1 3 2 0] """