How can I get total sum of each group by using pandas
Assuming you have the above dataframe as df:

df.weight = df.weight.astype(int)
df.weighted_hour = df.weighted_hour.astype(int)
df["Total_WH"] = df["weight"] + df["weighted_hour"]

df1 = df.groupby(['size'], as_index=False).sum().assign(ind='Total')

df = pd.concat([df, df1]).sort_values('size')