sorting arrays in numpy by column
- by user248237
How can I sort an array in numpy by the nth column? e.g.
a = array([[1,2,3],[4,5,6],[0,0,1]])
I'd like to sort by the second column, such that I get back:
array([[0,0,1],[1,2,3],[4,5,6]])
thanks.