Question

In pandas, what does df.groupby('A').agg({'B': 'sum', 'C': 'mean'}) return?

A A DataFrame with aggregated columns B and C by groups of A.
B A Series indexed by A with tuple values.
C Raises an error due to mixed aggregations.
D A list of DataFrames.
E A pivot table that loses grouping index.
Practice Next

Hey! Ask a query