title: How to read numbers in python from csv file?
body: <p>I have a csv file and I have to compute the mean for some of the columns.
  That's how I did:</p>
  
  <pre><code>file=csv.reader(open('tab.csv','r'))
  n=[]
  for row in file:
      n.append(row[8])
  </code></pre>
  
  <p>So I have a list of string : n=['','','1.58'...]
  How can I convert these to float?
  I tried with :</p>
  
  <pre><code>n_values=np.array(n)
  n_values[n=='']='0'
  values=n_values.astype(np.float)
  np.mean(values)
  </code></pre>
  
  <p>But the mean is not correct because I should skip the empty strings not counting.
  Thank for your help! </p>