用numpy.argsort函数
import numpy as np
a=[1,2,3,6,5,4]
b=["one","two","three","six","five","four"]
b=np.array(b)
sorted_indices=np.argsort(a)
print(sorted_indices)
sorted_b=b[sorted_indices]
print(sorted_b)
运行结果:
参考链接:
1.https://blog.csdn.net/junlee87/article/details/78636053