Can I use cumsum in pandas when I want to cum sum ~5000 categories?

35 Views Asked by At

I'm looking for a way to get a cumulative summation of my PERIOD_BAL for each of the %Entity_Acc categories.

Can this be done with cumsum or is there another way of doing this?

I'm relatively new to programming and have bee scouring everywhere to try and find something but can't.

1

There are 1 best solutions below

0
Akshat Pande On

If you are using pandas, it should be simple enough to use groupby with sum.

The code would be something like this:

summed_df = df.groupby('Column_name').sum()

Hope it helps!