convert datetime to number pandas code example
Example 1: convert a number column into datetime pandas
# convert the 'Date' column to datetime format
df['Date']= pd.to_datetime(df['Date'])
# Check the format of 'Date' column
df.info()
Example 2: convert datetime to date pandas
[dt.to_datetime().date() for dt in df.dates]