snowflake.snowpark.functions.mode

snowflake.snowpark.functions.mode(e: Union[Column, str]) Column[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.26.0/snowpark-python/src/snowflake/snowpark/functions.py#L1080-L1093)

Returns the most frequent value for the records in a group. NULL values are ignored. If all the values are NULL, or there are 0 rows, then the function returns NULL.

Example:

>>> df = session.create_dataframe([1, 3, 10, 1, 4], schema=["x"])
>>> df.select(mode("x").as_("x")).collect()
[Row(X=1)]
Copy
Language: English