title: Nested lists and converting to floats
body: <p>I'm trying to read some numbers from a text file and convert them to a list of floats, but nothing I try seems to work right.</p>
  
  <p>Here's my code right now:</p>
  
  <pre><code>python_data = open('C:\Documents and Settings\redacted\Desktop\python_lengths.txt','r')
  python_lengths = []
  for line in python_data:
      python_lengths.append(line.split())
  python_lengths.sort()
  
  print python_lengths
  </code></pre>
  
  <p>It returns:</p>
  
  <pre><code>[['12.2'], ['26'], ['34.2'], ['5.0'], ['62'], ['62'], ['62.6']]
  </code></pre>
  
  <p>(all brackets included)</p>
  
  <p>But I can't convert it to a list of floats with any regular commands like:</p>
  
  <pre><code>python_lengths = float(python_lengths)
  </code></pre>
  
  <p>or:</p>
  
  <pre><code>float_lengths = [map(float, x) for x in python_lengths]
  </code></pre>
  
  <p>because it seems to be nested or something?</p>