python - Sorting arrays in NumPy by column - Stack Overflow
https://stackoverflow.com/questions/2828059/sorting-arrays-in-numpy-by-column
WebMay 13, 2010 · How do I sort a NumPy array by its nth column? For example, given: a = array([[9, 2, 3], [4, 5, 6], [7, 0, 5]]) I want to sort the rows of a by the second column to obtain: array([[7, 0, 5], [9, 2, 3], [4, 5, 6]]) python. arrays. sorting. numpy. scipy. Share. Improve this question. Follow. edited Jun 20, 2022 at 3:02. Mateen Ulhaq. 25.8k 20 111 143
DA: 8 PA: 93 MOZ Rank: 43