title: Sorting 2D by rank
body: <p>I want to sort my 2D array to match the rank of another array</p>
  
  <p>I have tried the <code>sorted()</code> and <code>sort()</code> function and it's not working. I am not sure if I am formatting it wrong or what is the best way to do it.</p>
  
  <pre><code>array = (32,96)
  ranked =  [57, 23, 68, 58, 25, 91, 70, 83, 77, 75, 89, 34, 49, 79, 66, 54, 67,
         44, 63, 52, 46, 20, 64, 10, 80, 33, 30, 29, 28, 26, 17, 27, 50, 51,
         92, 86, 69, 47,  0,  7,  3, 85, 18, 11, 13, 53,  8, 78, 82, 81, 14,
         74, 59, 32, 42, 39,  1, 31, 36, 19, 24,  5, 38,  9, 73, 71, 76, 87,
         41, 55, 94, 93, 84, 16, 90, 62, 48, 43, 72, 95, 65, 45, 61, 22, 21,
         15, 37, 88,  2, 40, 56,  6, 12, 60,  4, 35]
  sortedarray = sorted(array,ranked)
  </code></pre>
  
  <p>for the code above i get an error:</p>
  
  <pre><code>TypeError: 'list' object is not callable
  </code></pre>
  
  <p>ranked has 96 values that correspond to the second dimension in the original array.</p>