Can't convert column with pandas.to_numeric
<p>I have a column of data, here is a snip of it:</p>

<pre><code>a = data["hs_directory"]["lat"][:5]

0     40.67029890700047
1      40.8276026690005
2    40.842414068000494
3     40.71067947100045
4    40.718810094000446
Name: lat, dtype: object
</code></pre>

<p>I try to convert it to numerical with python, but fail:</p>

<pre><code>pandas.to_numeric(a, errors='coerce')
</code></pre>

<p>This line does nothing, the dtype is still "object" and I can't do mathematical operations with the column. What am I doing wrong?</p>

<p>As discussed in the comments, let me post the answer for future readers:</p>

<p>try:</p>

<pre><code>df1=pd.to_numeric(a,errors='coerce')
</code></pre>

python pandas converter