Assuming I have the following dataframe:
a b c Sce1 Sce2 Sce3 Sce4 Sce5 Sc6 Animal Ground Dog 0.0 0.9 0.5
you need to do two group by to get subtotals at every level of aggregation. Then add those back in to the initial DF. Here's a related question.
group by