pandas.DataFrame.agg: Apply Different Aggregations to Different Columns

If you want to apply different aggregations to different columns, insert a dictionary of column and aggregation methods to the DataFrame.agg method.

The code above shows an example of this method.

Link to the source code.

Scroll to Top

Work with Khuyen Tran

Work with Khuyen Tran