Consider that I load columns from a text file using:
x, y, z = np.loadtxt(myfile, unpack=True)
What would be the syntax to sort x, y and z by increasing values of x ?
x
y
z
You want to use numpy.argsort
numpy.argsort
argsortx = np.argsort(x) x, y, z = x[argsortx], y[argsortx], z[argsortx]
Sign up using Google
Sign up using Facebook
Sign up using Stack Exchange
By posting your answer, you agree to the privacy policy and terms of service.
asked
1 year ago
viewed
87 times
active