Python Tricks
A list of various tips and tricks for doing neat things in Python.
NumPy Tricks
- To sort an array
xby rows:x_sorted = x[np.argsort(x[:,0]),:]
A list of various tips and tricks for doing neat things in Python.
x by rows: x_sorted = x[np.argsort(x[:,0]),:]Last updated 01 September 2010