python -- numpy 二维数组排序

对num_all先按照第二列排序,再第三列
这个搞了很久,记下来

idex = np.lexsort([num_all[:, 2], num_all[:, 1]])
sorted_num_all = num_all[idex, :]
print(sorted_num_all)

猜你喜欢

转载自blog.csdn.net/s000da/article/details/81006040