title: Sortrows with multiple sorting keys in numpy
body: <p>I haven't found this answer on SO, so I am sharing it here:</p>
  
  <p>Question:  How do you emulate sortrows functionality in matlab when there are multiple sorting keys?  In matlab, this looks like e.g.:</p>
  
  <pre><code>sortrows(x,[3,-4])
  </code></pre>
  
  <p>which sorts first by the 3rd column and then by the second column.</p>
  
  <p>If you were sorting by one column, you could use <code>np.argsort</code> to find the indices of that column, and apply those indices.  But how do you do it for multiple columns?</p>