title: How to gracefully fallback to `NaN` value while reading integers from a CSV with Pandas?
body: <p>While using <code>read_csv</code> with Pandas, if i want a given column to be converted to a type, a malformed value will interrupt the whole operation, without an indication about the offending value.</p>
  
  <p>For example, running something like:</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  
  
  df = pd.read_csv('my.csv', dtype={ 'my_column': np.int64 })
  </code></pre>
  
  <p>Will lead to a stack trace ending with the error: </p>
  
  <pre><code>ValueError: cannot safely convert passed user dtype of &lt;i8 for object dtyped data in column ...
  </code></pre>
  
  <p>If i had the row number, or the offending value in the error message, i could add it to the list of known <code>NaN</code> values, but this way there is nothing i can do.</p>
  
  <p>Is there a way to tell the parser to ignore failures and return a <code>np.nan</code> in that case?</p>
  
  <p>Post Scriptum: Funnily enough, after parsing without any type suggestion (no <code>dtype</code> argument), <code>d['my_column'].value_counts()</code> seems to infer the <code>dtype</code> right and put <code>np.nan</code> correctly automatically, even though the actual <code>dtype</code> for the series is a generic <code>object</code> which will fail on almost every plotting and statistical operation</p>