0

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 ?

1 Answer 1

2

You want to use numpy.argsort

argsortx = np.argsort(x) x, y, z = x[argsortx], y[argsortx], z[argsortx] 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.