I’m currently working on a dataframe that has a subscription date for every members. I would like to stats subscriptions per months but default behavior would counts each dates of every month separately.
I found a way of doing it modifying the date with slices and setting every dates day on 01 but i would rather use something that’s made by pandas.
Any suggestion on where i should head to ?
If your subscription date is a
datetime.datetimeinstance, then you could use (untested) something like (wheredfis yourDataFrame):You’ll need to adjust the groupby if the datetime isn’t your DataFrame’s index.