how to convert data in date format dataframe code example
Example 1: format date field in pandas
df['date'] = pd.to_datetime(df["date"].dt.strftime('%Y-%m'))
Example 2: apply format to pandas datetime column
formatted_df = df["Date"].dt.strftime("%m/%d/%y")