title: Sort a numpy 2d array by 1st row, maintaining columns
body: <p>In python, I have a numpy array of the form:</p>
  
  <pre><code>[4 8 2 0 5]
  [3 1 6 8 1]
  [2 2 6 0 3]
  [9 7 6 7 8]
  [5 8 1 1 4]
  </code></pre>
  
  <p>I want to sort it by the value of the first row from left to right in ascending order, while keeping the columns as a whole intact. The actual arrays are of unspecified dimensions, and pretty gigantic, so writing something myself with for loops get prohibitively slow. The result should be:</p>
  
  <pre><code>[0 2 4 5 8]
  [8 6 3 1 1]
  [0 6 2 3 2]
  [7 6 9 8 7]
  [1 1 5 4 8]
  </code></pre>
  
  <p>I can get a row vector with the column indexes ordered correctly using argsort, but don't know where to go from there on actually building the new array. </p>