A pivot table shows a summary as a grid: one thing down the side, another across the top, and a number in each cell. If you've built PivotTables in a spreadsheet, it's the same idea.
df.pivot_table(index="region", columns="category", values="revenue", aggfunc="sum")
index: what goes down the rows
columns: what goes across the top
values: the column to summarize
aggfunc: how to summarize it
Watch the default: without aggfunc, pivot_table calculates the mean, not the sum. Pass aggfunc="sum" when you want totals.
Combinations with no data come out as NaN; fill_value=0 puts zeros there instead. margins=True adds an All row and column with totals.
A pivot table holds the same numbers as df.groupby(["region", "category"])["revenue"].sum(), laid out wide instead of long.