The same table, but with the empty combinations shown as 0 instead of NaN

pandas · from pivot_table and crosstab

pivot_tableindex/columns/valuesaggfuncfill_valuemarginscrosstab

Putting the kettle on…

Starting up…

Exercise 2

The same table, but with the empty combinations shown as 0 instead of NaN.

your answer
stuck? the lesson behind it
pivot_table and crosstab
The same aggregation, with the second key across the top instead of down the side.