title: Sort multi-dimension numpy array along a dimension
body: <p>Let's say I have a 2D numpy array, and I want to sort it as if it was a standard Python list, i.e. putting its rows themselves in (lexicographical) order, as opposed to the cells along an axis. So from this:</p>
  
  <pre class="lang-py prettyprint-override"><code>&gt;&gt;&gt; a = np.array([[1, 3], [2, 1], [1, 2]]
  array([[1, 3],
         [2, 1],
         [1, 2]])
  </code></pre>
  
  <p>I want to arrive at this:</p>
  
  <pre class="lang-py prettyprint-override"><code>array([[1, 2],
         [1, 3],
         [2, 1]])
  </code></pre>
  
  <p>Unfortunately, it is not so easy:</p>
  
  <pre class="lang-py prettyprint-override"><code>&gt;&gt;&gt; np.sort(a, axis=0)
  array([[1, 1],
         [1, 2],
         [2, 3]])
  
  &gt;&gt;&gt; sorted(list(a))
  ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
  
  &gt;&gt;&gt; np.sort(list(a))
  array([[1, 1],
         [1, 2],
         [2, 3]])
  </code></pre>
  
  <p>I know this might (should!) be super basic, but I cannot, for the life of me, figure out how to do it. Thanks!</p>