title: error using astype when NaN exists in a dataframe
body: <pre><code>df
       A     B  
  0   a=10   b=20.10
  1   a=20   NaN
  2   NaN    b=30.10
  3   a=40   b=40.10
  </code></pre>
  
  <p>I tried :</p>
  
  <pre><code>df['A'] = df['A'].str.extract('(\d+)').astype(int)
  df['B'] = df['B'].str.extract('(\d+)').astype(float)
  </code></pre>
  
  <p>But I get the following error:</p>
  
  <blockquote>
    <p>ValueError: cannot convert float NaN to integer</p>
  </blockquote>
  
  <p>And:</p>
  
  <blockquote>
    <p>AttributeError: Can only use .str accessor with string values, which use np.object_ dtype in pandas</p>
  </blockquote>
  
  <p>How do I fix this ?</p>