1# You can use "astype" method
2# suppose you want to correct your "sales" column data type
3df['sales'] = df['sales'].astype('float64')
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>>> df.astype({'col1': 'int32'}).dtypes
2col1 int32
3col2 int64
4dtype: object
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)
6