I know there are many questions and answers about date format in a data frame, but I was quite able to find the answer to my question.
I got a data frame with a date format like this: "Tue, Oct 22, 2019". However, I would like to try and convert it into this format : %Y-%m-%d.
Here's what I tried :
nba_score['Date'] = pd.to_datetime(nba_score['Date'],format="%a %b %d %Y").strftime('%Y-%m-%d')
But I receive this error : ValueError: time data 'Tue, Oct 22, 2019' does not match format '%a %b %d %Y' (match)
Then I tried to add commas to reflect the right format like this:
nba_score['Date'] = pd.to_datetime(nba_score['Date'],format="%a, %b %d, %Y").strftime('%Y-%m-%d')
And I receive this error: AttributeError: 'Series' object has no attribute 'strftime'
Any help would be appreciated.