title: Convert Pandas column containing NaNs to dtype `int`
body: <p>I read data from a .csv file to a Pandas dataframe as below. For one of the columns, namely <code>id</code>, I want to specify the column type as <code>int</code>. The problem is the <code>id</code> series has missing/empty values.</p>
  
  <p>When I try to cast the <code>id</code> column to integer while reading the .csv, I get:</p>
  
  <pre><code>df= pd.read_csv("data.csv", dtype={'id': int}) 
  error: Integer column has NA values
  </code></pre>
  
  <p>Alternatively, I tried to convert the column type after reading as below, but this time I get:</p>
  
  <pre><code>df= pd.read_csv("data.csv") 
  df[['id']] = df[['id']].astype(int)
  error: Cannot convert NA to integer
  </code></pre>
  
  <p>How can I tackle this?</p>