title: When to apply(pd.to_numeric) and when to astype(np.float64) in python?
body: <p>I have a pandas DataFrame object named <code>xiv</code> which has a column of <code>int64</code> Volume measurements.  </p>
  
  <pre><code>In[]: xiv['Volume'].head(5)
  Out[]: 
  
  0    252000
  1    484000
  2     62000
  3    168000
  4    232000
  Name: Volume, dtype: int64
  </code></pre>
  
  <p>I have read other posts (like <a href="https://stackoverflow.com/questions/21287624/pandas-dataframe-column-type-conversion?rq=1">this</a> and <a href="https://stackoverflow.com/questions/15891038/pandas-change-data-type-of-columns">this</a>) that suggest the following solutions.  But when I use either approach, it doesn't appear to change the <code>dtype</code> of the underlying data:</p>
  
  <pre><code>In[]: xiv['Volume'] = pd.to_numeric(xiv['Volume'])
  
  In[]: xiv['Volume'].dtypes
  Out[]: 
  dtype('int64')
  </code></pre>
  
  <p>Or...</p>
  
  <pre><code>In[]: xiv['Volume'] = pd.to_numeric(xiv['Volume'])
  Out[]: ###omitted for brevity###
  
  In[]: xiv['Volume'].dtypes
  Out[]: 
  dtype('int64')
  
  In[]: xiv['Volume'] = xiv['Volume'].apply(pd.to_numeric)
  
  In[]: xiv['Volume'].dtypes
  Out[]: 
  dtype('int64')
  </code></pre>
  
  <p>I've also tried making a separate pandas <code>Series</code> and using the methods listed above on that Series and reassigning to the <code>x['Volume']</code> obect, which is a <code>pandas.core.series.Series</code> object.</p>
  
  <p>I have, however, found a solution to this problem using the <code>numpy</code> package's <code>float64</code> type - <strong><em>this works but I don't know why it's different</em></strong>.</p>
  
  <pre><code>In[]: xiv['Volume'] = xiv['Volume'].astype(np.float64)
  
  In[]: xiv['Volume'].dtypes
  Out[]: 
  dtype('float64') 
  </code></pre>
  
  <p>Can someone explain how to accomplish with the <code>pandas</code> library what the <code>numpy</code> library seems to do easily with its <code>float64</code> class; that is, convert the column in the <code>xiv</code> DataFrame to a <code>float64</code> in place.</p>