title: How to convert a list of strings and numbers to float in python?
body: <p>I need to get data from a csv file which I have done and have appended the data to a list but don't know how to make the entire list into a float.</p>
  <p>I tried the following code and it did not work:</p>
  <pre><code>import csv 
  
  with open('csv1.csv', 'r') as f:
      lines = f.readlines()[6]
      new_list = []
      for i in lines:
          print(lines)
          new_list.append(float(i))
          print(new_list)
  </code></pre>
  <p>I got a ValueError message. ValueError: could not convert string to float: '&quot;' which is weird since I don't understand where it is getting the &quot; from.</p>
  <p>The CSV file I am using is from Bureau Of Economic, here's the link to the exact file I am using: <a href="https://apps.bea.gov/iTable/iTable.cfm?reqid=19&amp;step=2#reqid=19&amp;step=2&amp;isuri=1&amp;1921=survey" rel="nofollow noreferrer">https://apps.bea.gov/iTable/iTable.cfm?reqid=19&amp;step=2#reqid=19&amp;step=2&amp;isuri=1&amp;1921=survey</a></p>