To change column type in Python Pandas, we can use the to_numeric
function.
For instance, we write
s = pd.Series(["8", 6, "7.5", 3, "0.9"])
pd.to_numeric(s)
to call to_numeric
on the s
series to convert all entries in the series from strings to numbers.