Skip to main contentSkip to solution

The default aggregate function in the context of "pivot tables" is ______________.

Solution

✅ Correct Option: 3

In pandas, the pivot_table() function uses aggfunc='mean' by default. If no aggregate function is given, it groups the data by the index and column labels and returns the mean of the values in each group.

For example, df.pivot_table(values='Sales', index='Region') gives the average sales for each region.

Excel's PivotTable is different: its default for numeric fields is Sum, which is not among the options.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question