snowflake.snowpark.functions.mode

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

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
语言: 中文