Loading...

verticapy.vDataFrame.max#

vDataFrame.max(columns: str | list[str] | None = None, **agg_kwargs) TableSample#

Aggregates the vDataFrame by applying the MAX aggregation, which calculates the maximum value, for the specified columns. This aggregation provides insights into the highest values within the dataset, aiding in understanding the data distribution.

Parameters#

columns: SQLColumns, optional

List of the vDataColumns names. If empty, all vDataColumns are used.

**agg_kwargs

Any optional parameter to pass to the Aggregate function.

Returns#

TableSample

result.

Examples#

For this example, we will use the following dataset:

import verticapy as vp

data = vp.vDataFrame(
    {
        "x": [1, 2, 4, 9, 10, 15, 20, 22],
        "y": [1, 2, 1, 2, 1, 1, 2, 1],
        "z": [10, 12, 2, 1, 9, 8, 1, 3],
    }
)

Now, let’s calculate the maximum for specific columns.

data.max(
    columns = ["x", "y", "z"],
)
max
"x"22.0
"y"2.0
"z"12.0

Note

All the calculations are pushed to the database.

Hint

For more precise control, please refer to the aggregate method.

See also

vDataFrame.min() : Minimum for particular columns.
vDataColumn.max() : Maximum for a specific column.