Skip to content
Advertisement

Pandas DateTime for Month

I have month column with values formatted as: 2019M01 To find the seasonality I need this formatted into Pandas DateTime format. How to format 2019M01 into datetime so that I can use it for my seasonality plotting? Thanks.

Advertisement

Answer

Use to_datetime with format parameter:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement