title: Python sort partial list items
body: <p>I have parsed a tsv file and have this structure:</p>
  
  <pre><code>[['x1','y1','x2','y2'],
  [1,1,0,80],
  [.95,1,.05,70],
  [.93,1,.1,65],
  …
  ]
  </code></pre>
  
  <p>My <code>x1</code> values are in descending order; starting from <code>1</code> going down to <code>0</code>. My <code>x2</code> values are in ascending order; starting from <code>0</code> going up to <code>1</code>. I need both to be in ascending order. I can't just flip the list or else <code>x2</code> will be in descending order. Also, note that <code>x1</code> and <code>y1</code> are pairs, so whatever we do to <code>x1</code> we must do to <code>y1</code> to make sure the data is still preserved.</p>
  
  <p>I have omitted my attempt out of shame, but if everyone promises not to laugh, what I tried was adding a <code>-i</code> to get the nth last item from my original list. <code>raw_data</code> is the data structure seen above.</p>
  
  <pre><code>new_list = [[raw_data[2][-i], raw_data[3][-i]] for i in raw_data
  </code></pre>
  
  <p>Unfortunately, that did not work.</p>
  
  <p><strong>Question:</strong> How can I write a list comprehension such that my <code>x1</code> (and the corresponding <code>y1</code> values) are in ascending order? </p>