def sort_matrix(a,n=<NUM_LIT:0>):
a = _n.array(a)<EOL>return a[:,a[n,:].argsort()]<EOL>
This will rearrange the array a[n] from lowest to highest, and
rearrange the rest of a[i]'s in the same way. It is dumb and slow.

Returns a numpy array.