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
df['date_column'] = pd.to_datetime(df['datetime_column']).dt.date