title: How can I sort a list of lists by one of the items in the sublists?
body: <p>I have a list which looks as follows: </p>
  
  <pre><code>list = [[u'schei\xdfunwetter', u'storm', u'0.0007813'], [u'schei\xdfunwetter', u'goddamn', u'0.0002343'], [u'ingenieurin', u'night', u'0.0000442'], [u'ingenieurin', u'you', u'0.0000008'], [u'ingenieurin', u'NULL', u'0.0000004'], [u'ingenieurin', u'last', u'0.0000472'], [u'ingenieurin', u'anything', u'0.0000328']]
  </code></pre>
  
  <p>I'd like to sort this list by the number (=probability).
  Looking through previous questions/answers on Stackoverflow, I found the following solution, which seems to have worked for the list (<code>li = [['a1', 1, 1.56], ['b3', '6', 9.28], ['c2', 1, 6.25]...]</code>): </p>
  
  <pre><code>list.sort(key=itemgetter(2))
  </code></pre>
  
  <p>With my data however, this does not work and returns NONE. 
  As I thought that it had to do with the number being a string, I tried the following: </p>
  
  <pre><code>sorted_list = list.sort(key=lambda x: int(x[2]))
  </code></pre>
  
  <p>, but this returns another error: </p>
  
  <pre><code>ValueError: invalid literal for int() with base 10: '0.0000723'
  </code></pre>
  
  <p>Can anyone help?</p>