Hard to imagine 🥹 data analysis 📊without the aggregate functions.
Aggregation is one of the most useful descriptive analysis functions to perform complex statistical steps more efficiently. The primary purpose of the aggregate is to summarize the group of data to analyze the statistical summaries such as mean, standard deviation, variance, etc.
I quickly demonstrate various methods of using an aggregate function in Pandas in this article. For reproducing the code, I’ve attached the data set link here.

Let’s load the data set using Pandas
# Import Pandas Library
import pandas as pddf=pd.read_csv(‘IT_salary.csv’)
df.head(10)

1) Use the aggregate function to find the statistical summary of one variable
Here we are finding the average salary using Pandas aggregate function
value = df[‘Salary’].aggregate(‘mean’)
print(round(value,2))
Output:
695387.21
2) To find the statistical summary of one/many variables by grouping one variable
Here we are finding the statistical summary of each variable by grouping the Job Title Variable. Remember, the statistical summary only works on the numerical columns, and hence other columns are ignored.
2.1. Let’s find out the mean value for each category in JOB Title

2.2. Let’s find out the maximum values of each variable for each group of JOB title

3) Reporting various statistical summaries
Let’s find both minimum and maximum salary by grouping job-title.

4) Reporting various statistical summaries from various features
Here I am applying multiple aggregate functions(count, min, max) at the same time on various features (Company name and Salary) by grouping one variable (Job Title)

5) Group By Multiple Features
We can group multiple features using Pandas

6) Aggregate function with Group by Multiple Features
Also, we can group multiple variables to find the statistical summary of one/all variables. Here I am grouping the mean and sum salary based on JOB title and company

7) Use dictionary function to report various statistical summaries from various features
Let’s find out the maximum rating and sum of salary by grouping the Company Name.

So finally, in this article, I have described various pandas aggregation tricks to summarize the descriptive statistics of given data frame. Without the aggregate functions, it is really hard to analyze the summary of group of data. Also, there are many more options you can play around with aggregate function, However, for efficient programming, have a good practice on various dataset.
Happy Learning!
To learn more from me, follow me on LinkedIn
Amsavalli Mylasalam – Data Science Technical Assistant – aatomz research | LinkedIn
View Amsavalli Mylasalam’s profile on LinkedIn, the world’s largest professional community. Amsavalli has 5 jobs listed…
Regards
Amsavalli