# You can use "astype" method
# suppose you want to correct your "sales" column data type
df['sales'] = df['sales'].astype('float64')
>>> df.astype({'col1': 'int32'}).dtypes
col1 int32
col2 int64
dtype: object
# Individual
df['a'] = df_test['a'].astype('float64')
df['b'] = df_test['b'].astype('int64')
# Batch
dtype_d = {"a": "float64", "b": "int64"} # dtype dictio
df = df.astype(dtype_d)
df.astype(int)
df = pd.read_csv("weather.tsv", sep=" ",
dtype={'Day': str,'Wind':int64})
df.dtypes
# select columns that need to be converted
cols = df.select_dtypes(include=['float64']).columns.to_list()
df = df.astype({col:int for col in cols})
convert pandas datatype
df['current_anniversary_date'] = df['current_anniversary_date'].astype('datetime64[ns]')