title: How to convert str to a float?
body: <p>I imported a list full of floats as strings, and i tried to convert them to floats, but this error kept popping up</p>
  <pre><code>Traceback (most recent call last):
    File &quot;c:\Users\peter\Documents\coding\projects\LineFitting.py&quot;, line 12, in &lt;module&gt;
      StockPriceFile = float(value.strip(''))
  ValueError: could not convert string to float: 
  </code></pre>
  <p>this is what i did to try and convert the list:</p>
  <pre><code>#1
  for value in range(0, len(StockPriceFile)):
      StockPriceFile[value] = float(StockPriceFile[value])
  #2
  for value in StockPriceFile:
      value = float(value)
  #3
  StockPriceFile[0] = StockPriceFile[0].strip('[]')
  for value in StockPriceFile:
      StockPriceFile = float(value.strip(''))
  </code></pre>
  <p>(Sample Of Data)</p>
  <pre><code>['[36800.]', '36816.666666666664', '36816.666666666664', '36833.333333333336', '36866.666666666664']
  </code></pre>
  <p>where its being written:</p>
  <pre><code>Data_AvgFile.write(str(Average) + ',')
  </code></pre>
  <p>What does this mean? and how can i fix it? it works fine when i do it one by one.</p>
  <p>(also tell me if you need more data, i dont know if this is sufficient)</p>