I'm trying to sum 6 months of data separately for each team name I have, so that I can perform a linear regression model. I've used the following code, however it is grouping everything in my dataset, rather than just 'Area Team Name', which is specified in the code.
pivoted_df = pd.pivot_table(sample(), index="Month",values=["Actual Cost", "Area Team
Name"], aggfunc=np.sum)
print(pivoted_df)
Which gives me a result of...
Actual Cost
Month
AUGUST 2.156021e+07
DECEMBER 3.282076e+07
JULY 3.421666e+07
NOVEMBER 3.370295e+07
OCTOBER 3.466268e+07
SEPTEMBER 3.371625e+07