Python – trouble pivoting, grouping, and summing dataframe columns
Python – trouble pivoting, grouping, and summing dataframe columns Question: I have this code. I need to group by CustomerName and then sum the filegroups. def consolidated_df(): df = breakdown_df() df.pivot_table(index=’CustomerName’, columns=’FileGroup’, aggfunc="sum") return df breakdown_df() looks like ID CustomerName FileGroup Size Size(Bytes) 1 CustomerA Database 99.8 M 104667648 1 CustomerA Database 99.8 M 104667648 …