title: Python, ValueError: could not convert string to float:
body: <p>My script is picking up a string when it should not, I get </p>
  
  <blockquote>
    <p>ValueError: could not convert string to float: for line <code>list_col.append(float(row[c].strip('"')))</code> in the code below </p>
  </blockquote>
  
  <pre><code> with open(fileTwoName) as f:
  
      reader = csv.reader(f, delimiter=",")
      fileTwoColumnNames = next(reader)
      output_column .extend(fileTwoColumnNames[2:-1])
      number_of_columns = len(fileTwoColumnNames)-2
  
  
      for c in range(2,number_of_columns+2):
          list_col = []
          f.seek(1)
          next(reader)
          for row in reader:
              list_col.append(float(row[c].strip('"'))) 
  
          list_col_name_wise = []
          for k in range(0, len(number_eng)):
              list_col_name_wise.append(sum(list_col[start_row[k] - 1:start_row[k] - 1 + 1- total_case [k]]))
          data.append(list_col_name_wise)
  </code></pre>
  
  <p>I tested it by adding </p>
  
  <pre><code>if list_col == str:
      list_col.append(float(row[c].strip('"'))) ` 
  </code></pre>
  
  <p>everything outputs ok but I need my <code>data</code> list to output as a float. Is there a way for me to account for both a str and float?</p>