Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Advanced Aggregation [1/2] | Aggregating and Visualizing Data
Data Manipulation using pandas

Advanced Aggregation [1/2]

Sometimes one aggregate function is not enought to make complete conclusions. For instance, we may need to get not only minimal, but also maximal value per group. Can pandas handle it? Surely, it can!

If you want to apply more than one aggregate function to each group, use the .agg() method. Pass a list of function names (as strings!) you want to apply to each group as the parameter. For instance, we can get the minimal and maximal price for each value of the 'roomh' column (number of rooms).

Everything was clear?

Section 4. Chapter 1
course content

Course Content

Data Manipulation using pandas

Advanced Aggregation [1/2]

Sometimes one aggregate function is not enought to make complete conclusions. For instance, we may need to get not only minimal, but also maximal value per group. Can pandas handle it? Surely, it can!

If you want to apply more than one aggregate function to each group, use the .agg() method. Pass a list of function names (as strings!) you want to apply to each group as the parameter. For instance, we can get the minimal and maximal price for each value of the 'roomh' column (number of rooms).

Everything was clear?

Section 4. Chapter 1
some-alt