title: How to convert the elements of a python list of lists?
body: <p>I have a python list (<code>vals</code>) containing lists of strings like this:</p>
  <pre><code>[['540.0 ', '0.0 ', '0.0 ', '162.0 ', '2.5 ', '1040.0 ', '676.0 ', '28 ', '79.99 \r'], 
  
  ['540.0 ', '0.0 ', '0.0 ', '162.0 ', '2.5 ', '1055.0 ', '676.0 ', '28 ', '61.89 \r'], ...]
  </code></pre>
  <p>When I want to convert its elements with the code below, I get the following error:</p>
  <p><code>ValueError: could not convert string to float</code></p>
  <pre><code>vals = [[float(item) for item in rec] for rec in vals]
  </code></pre>
  <p>How can I solve this problem?</p>