Answered the child comment but let me copy paste here too. It's literally one (short) line:
> df.resample("BME").sum()
Assuming `df` is a dataframe (ie table) indexed by a timestamp index, which is usual for timeseries analysis.
"BME" stands for BusinessMonthEnd, which you can type out if you want the code to be easier to read by someone not familiar with pandas.
This one liner example is one of the reason why some people use pandas and some people despise it.
It so easy for my analyst team because of daily uses but my developers probavly will never thought/know BME and decided to implement the code again.