Summing Multiple Groups of Columns
问题 I have a situation where my data frame contains the results of image analysis where the columns are the proportion of a particular class present in the image, such that an example dataframe class_df would look like: id A B C D E F 1 0.20 0.30 0.10 0.15 0.25 0.00 2 0.05 0.10 0.05 0.30 0.10 0.40 3 0.10 0.10 0.10 0.20 0.20 0.30 Each of these classes belongs to a functional group and I want to create new columns where the proportions of each functional group are calculated from the classes. An