python - pandas groupby dates within a quarter - Stack Overflow

PHOTO EMBED

Fri Dec 10 2021 18:28:38 GMT+0000 (Coordinated Universal Time)

Saved by @adamyalei #python

df['date_of_order'] = pd.to_datetime(df['date_of_order']) # if you haven't converted it already

df.groupby(df['date_of_order'].dt.to_period('Q'))['column to aggregate'].agg(...)
content_copyCOPY

https://stackoverflow.com/questions/49949300/pandas-groupby-dates-within-a-quarter/49949464