Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Grouping in pandas [2/2] | Grouping Data
Data Manipulation using pandas
course content

Course Content

Data Manipulation using pandas

Grouping in pandas [2/2]

As you saw in the previous chapter, you received one number per group. But what will be the result after applying, for example, the .mean() method? Let's find out!

As you can see, you received means for all numerical columns. If you want to get aggregated statistics for only certain columns, make a selection right after applying the .groupby() function. For example, for each value of the 'morth' column we want to know average values of 'valueh', 'grosrth', 'omphtotinch' columns.

This time output looks much better. You got means for only selected columns. Zeros as means appeared as the result of house being mortgaged or not.

Everything was clear?

Section 3. Chapter 4
We're sorry to hear that something went wrong. What happened?
some-alt