Inside my Pandas dataframe, my 'Date' columns have strings of the format mm/dd/yyyy. What I want to do is convert them into YYYY-dd-mm.
df = pd.read_csv(csv_file, header=1)
date_list = df['Date'].values
for item in date_list:
item = pd.to_datetime(item).strftime('%Y-%m-%d')
print(item)
This code converts the dates successfully, but the dataframe is not changed. How can I make it change the dataframe with the new format?