title: pandas convert objects with numbers and nans to ints or floats
body: <p>with the knowledge that similar cases have been answered several times I couldn't make it work anyway.</p>
  
  <p>sample data:</p>
  
  <pre><code>10
  5
  20
  
  5
  
  6
  </code></pre>
  
  <p>after i figured out that with:</p>
  
  <pre><code>df = df['column_name'].astype(str).astype(int)
  </code></pre>
  
  <p>it would work if there wasn't nans in the input data.</p>
  
  <pre><code>error: invalid literal for int() with base 10: 'nan'
  </code></pre>
  
  <p>Also I did try to use float instead but it gives an error as well</p>
  
  <pre><code>error: could not convert string to float
  </code></pre>
  
  <p>what am I missing?</p>
  
  <p>output can be anything with "null", "nan", "" for example:</p>
  
  <pre><code>10
  5
  20
  null
  5
  null
  6
  </code></pre>