Calculate cumulative intraday measures that reset every day in pandas

A cumulative sum that resets is equivalent to apply it to groups : each new group will reset the cumulative sum when it starts. It is always easier to illustrate an answer with a good minimal reproducible example : df = pd.DataFrame([ [‘20191224’, ‘20191224 01:00’, 50, ‘Merry’], [‘20191224’, ‘20191224 02:30’, 50, ‘Christmas’], [‘20191225’, ‘20191225 02:00’, … Read more