pandas and NumPy 3 · Grouping and combining
Create a pivot table
Summarize values across two dimensions.
df.pivot_table(index="country", columns="plan", values="revenue", aggfunc="sum")
Official pandas and NumPy 3 documentation
More grouping and combining commands
- Group and aggregate
- Join two DataFrames
- Stack DataFrames
- Compute a moving average
- Aggregate by time period
- Save to a CSV file
All grouping and combining commands · pandas and NumPy 3 cheatsheet