You are viewing documentation about an older version (1.4.0). View latest version

snowflake.snowpark.RelationalGroupedDataFrame

class snowflake.snowpark.RelationalGroupedDataFrame(df: DataFrame, grouping_exprs: List[Expression], group_type: _GroupType)[source]

Bases: object

Represents an underlying DataFrame with rows that are grouped by common values. Can be used to define aggregations on these grouped DataFrames.

Methods

agg(*exprs)

Returns a DataFrame with computed aggregates.

avg(*cols)

Return the average for the specified numeric columns.

builtin(agg_name)

Computes the builtin aggregate agg_name over the specified columns.

count()

Return the number of rows for each group.

function(agg_name)

Computes the builtin aggregate agg_name over the specified columns.

max(*cols)

Return the max for the specified numeric columns.

mean(*cols)

Return the average for the specified numeric columns.

median(*cols)

Return the median for the specified numeric columns.

min(*cols)

Return the min for the specified numeric columns.

sum(*cols)

Return the sum for the specified numeric columns.