This is what Tom suggested and rightly so.
In [134]: s = pd.Series(['1','2.','na']) In [135]: s.convert_objects(convert_numeric=True) Out[135]: 0 1 1 2 2 NaN dtype: float64
As Andy points out, this does not work directly (I think this is a mistake), so first convert to all string elements, and then convert
In [136]: s2 = pd.Series(['1','2.','na',5]) In [138]: s2.astype(str).convert_objects(convert_numeric=True) Out[138]: 0 1 1 2 2 NaN 3 5 dtype: float64
source share