What do the aggfunc and margins arguments of pandas pivot_table() do?
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: easy
Interview Round: Other
Overview: Asks what the aggfunc and margins arguments control in a pandas pivot table and how the totals row and column are computed. It tests whether you know the default aggregation, the accepted forms of aggfunc, and why totals can disagree with the cells for averages.