Command
pd.pivot_table
Explanation
pd.pivot_table() is used to create spreadsheet-style pivot tables.
Examples
Pivot table with mean aggregation
pd.pivot_table(df, values="col1", index="col2", aggfunc="mean")
pd.pivot_table
pd.pivot_table() is used to create spreadsheet-style pivot tables.
Pivot table with mean aggregation
pd.pivot_table(df, values="col1", index="col2", aggfunc="mean")