snowflake.snowpark.RelationalGroupedDataFrame¶
- class snowflake.snowpark.RelationalGroupedDataFrame(df: DataFrame, grouping_exprs: List[Expression], group_type: _GroupType)[source]¶
Bases:
objectRepresents an underlying DataFrame with rows that are grouped by common values. Can be used to define aggregations on these grouped DataFrames.
See also
Methods
agg(*exprs, **kwargs)Returns a
DataFramewith computed aggregates.applyInPandas(func, output_schema, **kwargs)Maps each grouped dataframe in to a pandas.DataFrame, applies the given function on data of each grouped dataframe, and returns a pandas.DataFrame.
apply_in_pandas(func, output_schema, **kwargs)Maps each grouped dataframe in to a pandas.DataFrame, applies the given function on data of each grouped dataframe, and returns a pandas.DataFrame.
avg(*cols, **kwargs)Return the average for the specified numeric columns.
builtin(agg_name, **kwargs)Computes the builtin aggregate
agg_nameover the specified columns.count(**kwargs)Return the number of rows for each group.
function(agg_name, **kwargs)Computes the builtin aggregate
agg_nameover the specified columns.max(*cols, **kwargs)Return the max for the specified numeric columns.
mean(*cols, **kwargs)Return the average for the specified numeric columns.
median(*cols, **kwargs)Return the median for the specified numeric columns.
min(*cols, **kwargs)Return the min for the specified numeric columns.
pivot(pivot_col[, values, default_on_null])Rotates this DataFrame by turning unique values from one column in the input expression into multiple columns and aggregating results where required on any remaining column values.
sum(*cols, **kwargs)Return the sum for the specified numeric columns.