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).