One of the most basic analysis functions is grouping and aggregating
data. In some cases, this level of analysis may be sufficient to
answer business questions. In other instances, this activity might
be the first step in a more complex data science analysis. In
pandas, the groupby
function can be combined with one or more
aggregation functions to quickly and easily summarize data. This
concept is deceptively simple and most new pandas users will
understand this concept. However, they might be surprised at how
useful complex aggregation functions can be for supporting
sophisticated analysis.
This article will quickly summarize the basic pandas aggregation
functions and show examples of more complex custom
aggregations. Whether you are a new or more experienced pandas user,
I think you will learn a few things from this article.