【发布时间】:2013-05-07 09:20:16
【问题描述】:
考虑我使用以下方法从文本文件加载列:
x, y, z = np.loadtxt(myfile, unpack=True)
通过增加x 的值对x、y 和z 进行排序的语法是什么?
【问题讨论】:
标签: python arrays sorting numpy
考虑我使用以下方法从文本文件加载列:
x, y, z = np.loadtxt(myfile, unpack=True)
通过增加x 的值对x、y 和z 进行排序的语法是什么?
【问题讨论】:
标签: python arrays sorting numpy
你想使用numpy.argsort
argsortx = np.argsort(x)
x, y, z = x[argsortx], y[argsortx], z[argsortx]
【讨论】: