From the course: pandas Essential Training

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Groupby computations

Groupby computations - pandas Tutorial

From the course: pandas Essential Training

Start my 1-month free trial

Groupby computations

- [Instructor] There are several functions you can perform on a groupby object. The size function was gives you a count of each group is particularly helpful. But there are several others. Here's a helpful real world tip. Many times you might want to use the aggregation function. The aggregation function, AGG, allows multiple statistics to be calculated per group in one calculation. Instructions for aggregation are provided in the form of a python dictionary or a list. And the dictionary keys are where you specify which series or columns in your data frame you want to perform the operations and the actual dictionary values specify the function to run. You can also pass custom functions to the list of aggregated calculations and each will be passed the values from the column in your grouped data. Groupby is a very useful Pandas function and it's worth your time making sure you understand how to use it. Let's head over to the Jupyter Notebook to look at a couple of examples. As we…

Contents