[Matrix-SIG] Sorting arrays lexicographically by row

Edward C. Jones edcjones@erols.com
Tue, 20 Apr 1999 07:27:38 -0400


Here is a small piece of Python code:

arr = [[3,1], [3,0], [2,1], [1,0], [2,2]]
arr.sort()
print arr

The output is:

[[1, 0], [2, 1], [2, 2], [3, 0], [3, 1]]

Can I do this (lexicographic) type of sorting using NumPy on a
NumPy array?

Thanks,
  Ed Jones