# How can I get total sum of each group by using pandas

I have a dataframe shaped like below

size ind weight weighted_hour
1    A    17       40
1    B    20       41
1    C    19       42
2    A    50       30
2    B    20       10
2    C    13       16
3    A    17       19
3    B    21       23
3    C    23       30


and I want to insert some sum of criteria like below

size ind     weight weighted_hour Total_WH
1    A       17       40          57
1    B       20       41          61
1    C       19       42          61
1    Total   56       123         179
2    A       50       30          80
2    B       20       10          30
2    C       13       16          29
2    Total   83       56          139
3    A       17       19          36
3    B       21       23          44
3    C       23       30          53
3    Total   61       72          133


I prefer to use pandas but if someone can suggest more efficient method It's good either. Give me some advice. Thank you!

Assuming you have the above dataframe as df:
df.weight = df.weight.astype(int)