Convert the date column from strings to datetime objects and extract the month.
DataFrame df with columns: date, product, quantity, price, region (date is a string)
date column to datetimemonth column with the month numberReady to take your skills to the next level? Enroll in our comprehensive Data Analyst Career Track to master SQL, Python, Excel, and Power BI.
Run your code to see the result here.