I'm trying to summarize my dataframe on bee data. It's separated by state and year. I'm trying to find the annual averages of each column to create a dataframe that is a summary for the entire US bee population by year. I was trying to use this method, but I'm not getting the results I want.
usa = bees.groupby(['year'])['numcol'].mean()
usa['yieldpercol'] = bees.groupby('year')['yieldpercol'].mean()
usa['totalprod'] = bees.groupby('year')['totalprod'].mean()
The data frame looks like this: Dataframe