title: Sorting a csv file in Python with sorted() returns values in programmer DESC order, not time DESC order
body: <p>I'm not doing anything overly complex I believe. I'm presorting a large csv data file because it is full of data that arrives in random time order. The index is correct, but the return formatting is off.</p>
  
  <pre><code>    sortedList=sorted(reader,key=operator.itemgetter(1))
  </code></pre>
  
  <p>So instead of sorting like [-100 -10 -1 0 10 100 5000 6000]; I get [-1 -10 -100 0 100 5000 60]</p>
  
  <p>I tried both the lambda function examples and itemgetter, but I don't really know where to go from there. </p>
  
  <p>Thanks for the help.</p>
  
  <p>The answer to my question is in the comments. The numerical value was being sorted as a string and not a number. I didn't know that I could specify the data type of the key in sorted(). This code works as I intended:</p>
  
  <pre><code>    sortedList=sorted(reader,key=lambda x:float(x[1]))
  </code></pre>