code: def sort_matrix(a,n=0):
      
      a = _n.array(a)
      return a[:,a[n,:].argsort()]
docs: 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.