column dataframe to int
df[[column_name]].astype(int)
column of type int to date pandas
df['DataFrame Column'] = pd.to_datetime(df['DataFrame Column'], format=specify your format)
#Example
import pandas as pd
values = {'dates': [20190902,20190913,20190921],
'status': ['Opened','Opened','Closed']
}
df = pd.DataFrame(values, columns = ['dates','status'])
df['dates'] = pd.to_datetime(df['dates'], format='%Y%m%d')
print (df)
print (df.dtypes)
convert a pandas column to int
# convert Series
my_series = pd.to_numeric(my_series)
# convert column "a" of a DataFrame
df["a"] = pd.to_numeric(df["a"])
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us