Data aggregation of grouped data
Data aggregation involves the process of gathering data and presenting it in a summary form, such as showing its statistics. Aggregation itself is the process of gathering data for statistical purposes and presenting it as a number. In this section, we look at how to perform data aggregation in Danfo.js
Here is a list of all the available aggregation methods:
mean()
: To calculate the mean of grouped datastd()
: To calculate the standard deviationsum()
: To get the sum of values in a groupcount()
: To count the total number of values per groupmin()
: To get the minimum value per groupmax()
: To get the maximum value per group
At the start of this chapter, we saw how we can call some of the aggregate methods listed previously on group data. The groupby
class also contains a method called .agg
, which allows us to apply different aggregate operations to different columns at the same time.