snowflake.snowpark.functions.regr_count¶
- snowflake.snowpark.functions.regr_count(y: Union[Column, str], x: Union[Column, str]) Column [source] (https://github.com/snowflakedb/snowpark-python/blob/v1.30.0/snowpark-python/src/snowflake/snowpark/functions.py#L11237-L11250)¶
Returns the number of non-null number pairs in a group.
Example:
>>> df = session.create_dataframe([[1, 10, 11], [1, 20, 22], [1, 25, None], [2, 30, 35]], schema=["k", "v", "v2"]) >>> df.group_by("k").agg(regr_count(col("v"), col("v2")).alias("regr_count")).collect() [Row(K=1, REGR_COUNT=2), Row(K=2, REGR_COUNT=1)]