I was wondering how to add a column "total" to a pandas dataframe, containing the sum of all rows beyond that particular row. To clarify what I mean: I already have "index" and "number", and I want to create "total":
index number total
0 5 18 (5+7+3+1+2)
1 7 13 (7+3+1+2)
2 3 6 (3+1+2)
3 1 3 (1+2)
4 2 2
I have no idea where to start, some help would be greatly appreciated!
Thanks a lot in advance.