xxxxxxxxxx
pd.Timestamp('2014-01-23 00:00:00', tz=None).to_pydatetime()
xxxxxxxxxx
df['date_column'] = pd.to_datetime(df['datetime_column']).dt.date
xxxxxxxxxx
import pandas as pd
# Assuming you have a data frame called df with a column named 'date' containing object or string data
df['date'] = pd.to_datetime(df['date'])
# If the date column contains any format other than the default format '%Y-%m-%d', specify the format using the 'format' parameter
# For example, if the date format is '%d-%m-%Y', you can use:
# df['date'] = pd.to_datetime(df['date'], format='%d-%m-%Y')
xxxxxxxxxx
import pandas as pd
df = pd.Dataframe(data)
df.index = pd.DatetimeIndex(data=df.index, tz='US/Eastern') # naive--> aware
df.index = pd.DatetimeIndex(df.index.tz_convert('US/Pacific')) # aware--> aware
df