title: How to sort two dimensional list while giving priority along one of the dimension
body: <p>I am trying to sort a two-dimensional list while prioritizing sorting along one of the dimensions.</p>
  
  <p>Example:</p>
  
  <pre><code>twod_list = [[116.2,103.4],[124.9,103.4],[129.5,103.4],
               [144.6,103.4],[148.9,103.4],
               [119.1,109.3],[125.9,103.4],[146.3,109.3],[135.8,103.4]]
  </code></pre>
  
  <p>I am trying to sort this in the following order, first sort along the second dimension, then sort along the first dimension while maintaining the order on the second dimension. So my expected sorted list looks like below</p>
  
  <pre><code>sorted_twod_list = [[116.2,103.4],[124.9,103.4],[125.9,103.4],[129.5,103.4],[135.8,103.4],
               [144.6,103.4],[148.9,103.4],
               [119.1,109.3],[146.3,109.3]]
  </code></pre>
  
  <p>I tried to sort first along the second dimension then on the first dimension but in doing so it is changing the order.</p>
  
  <pre><code>twod_list = [[116.2,103.4],[124.9,103.4],[129.5,103.4],
               [144.6,103.4],[148.9,103.4],
               [119.1,109.3],[124.9,103.4],[146.3,109.3],[135.8,103.4]]
  twod_sorted_on_y = sorted(twod_list,key=lambda l:l[1])
  twod_sorted = sorted(twod_sorted_on_y,key=lambda l:l[0])
  </code></pre>
  
  <p>I am getting the following result:</p>
  
  <pre><code>twod_sorted = [[116.2, 103.4],[119.1, 109.3],[124.9, 103.4],
                 [124.9, 103.4],[129.5, 103.4],
                 [135.8, 103.4],[144.6, 103.4],[146.3, 109.3],[148.9,103.4]]
  </code></pre>
  
  <p>We can also accomplish this using if condition, but I want to know whether any short cut exists using numpy or pandas?</p>