O'Reilly logo

Learning pandas - Second Edition by Michael Heydt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Accessing the results of a grouping

The grouped variable can be thought of as a collection of named groups and can be used to examine the contents of the groupings. Let's examine these groupings using the following function:

This function will loop through each of the groups and print its name and the first five rows:

An examination of these results gives us some insights into how pandas has performed the split. A group has been created for each distinct value in the sensors column, and the group is named after the value. Each group then contains ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required