Aggregate Methods
Learn how to do aggregation on a Series.
We'll cover the following...
Aggregate methods collapse the values of a Series down to a scalar. It allows us to take detailed data and collapse it to a single value.
Aggregations
If we want to calculate the mean value of a Series, we can use the aggregation method mean
:
Press + to interact
print(city_mpg.mean())
There are also a few aggregate properties. These start with is_
. These are not functions but are rather the attributes of the Series class. We do not call them, and they evaluate to True
or False
:
Press + to interact
print(city_mpg.is_unique)print(city_mpg.is_monotonic_increasing)
One method we need to be aware of is the quantile
method. By ...