title: Pandas convert data type from object to float
body: <p>I read some weather data from a <code>.csv</code> file as a dataframe named &quot;weather&quot;. The problem is that the data type of one of the columns is <code>object</code>. This is weird, as it indicates temperature. How do I change it to having a <code>float</code> data type? I tried <code>to_numeric</code>, but it can't parse it.</p>
  <pre><code>weather.info()
  weather.head()
  
  &lt;class 'pandas.core.frame.DataFrame'&gt;
  DatetimeIndex: 304 entries, 2017-01-01 to 2017-10-31
  Data columns (total 2 columns):
  Temp    304 non-null object
  Rain    304 non-null float64
  dtypes: float64(1), object(1)
  memory usage: 17.1+ KB
  
             Temp     Rain
  Date        
  2017-01-01  12.4    0.0
  2017-02-01  11      0.6
  2017-03-01  10.4    0.6
  2017-04-01  10.9    0.2
  2017-05-01  13.2    0.0
  </code></pre>