1# convert all columns of DataFrame
2df = df.apply(pd.to_numeric) # convert all columns of DataFrame
3
4# convert just columns "a" and "b"
5df[["a", "b"]] = df[["a", "b"]].apply(pd.to_numeric)
1# convert Series
2my_series = pd.to_numeric(my_series)
3
4# convert column "a" of a DataFrame
5df["a"] = pd.to_numeric(df["a"])
6