title: pandas read in csv column as float and set empty cells to 0
body: <p>Is it possible to read in a CSV as a pandas DataFrame and set spaces (or empty cells) to 0 in one line? Below is an illustration of the problem.</p>
  
  <p><strong>Input:</strong></p>
  
  <pre><code>$ csvlook data.csv    
  |------+---+------|
  |  a   | b | c    |
  |------+---+------|
  |      | a | 0.0  |
  |  0   | b | 1.0  |
  |  1.5 | c | 2.5  |
  |  2.1 | d | 3.0  |
  |------+---+------|
  </code></pre>
  
  <p><strong>What I Want:</strong></p>
  
  <pre><code>python% print(df)
      a   b   c
  0   0   a   0.0
  1   0   b   1.0
  2   1.5 c   2.5
  3   2.1 d   3.0
  </code></pre>
  
  <p><strong>What I've Tried:</strong></p>
  
  <pre><code>df = pd.read_csv('data.csv', dtype={'a': float, 'b': str, 'c': float})
  </code></pre>
  
  <p>Which spits out a ValueError due to the whitespace in the 0th row of column a:</p>
  
  <pre><code>ValueError: could not convert string to float: 
  </code></pre>
  
  <p>Is there a way of replacing strings with 0s when reading in a CSV with pandas?</p>
  
  <p><strong>Code to Generate Test Data:</strong></p>
  
  <p>If you want to try it out, here are the lines I used to generate the test data in the above example:</p>
  
  <pre><code>import pandas as pd
  df = pd.DataFrame({'a':[' ', 0, 1.5, 2.1], 'b':['a', 'b', 'c', 'd'], 'c': [0, 1, 2.5, 3]})
  df.to_csv('data.csv', index=False)
  </code></pre>