pyspark.sql.GroupedData.max

GroupedData.max(*cols)[source]

Computes the max value for each numeric columns for each group.

New in version 1.3.0.

Examples

>>> df.groupBy().max('age').collect()
[Row(max(age)=5)]
>>> df3.groupBy().max('age', 'height').collect()
[Row(max(age)=5, max(height)=85)]