Python code for AGGREGATE function in excel

You can see examples of the AGGREGATE function below:

python code for the AGGREGATE function

NameAgeHeightWeight
Olivia25210180
Noah25205235
Oliver27195205
Elijah22198185
James29199231
William29201240
Benjamin21202235
Lucas25200238
Henry22204190
import pandas as pd

df =pd.read_csv("example.csv") 

out=df.aggregate({"Height":['max', 'min'],"Age":['max', 'min'],"Weight":['min', 'max']})

print(out)

Height Age Weight

max 210 29 240
min 195 21 180

AGGREGATE function

The AGGREGATE function is one of the math functions of Excel.

This function has multiple argument lists.

AGGREGATE arguments

This function has just 1 Argument:

The argument of AGGREGATE function is number.

Function_num is the number 1 to 19 that specifies the summary function for the aggregate.

The argument of AGGREGATE function is required and not optional.

AGGREGATE(number) = number

Leave a Reply

Your email address will not be published. Required fields are marked *