Let's say I have a dataframe that looks like this:
Input
item_code qty
10034 5
4
3
10035 2
1
I would like to add a new column name total after the qty column and put sum total qty according to item_code column.
output
item_code qty total
10034 5 12
4
3
10035 2 3
1