snowflake.snowpark.functions.count¶
- snowflake.snowpark.functions.count(e: Union[Column, str]) Column [source] (https://github.com/snowflakedb/snowpark-python/blob/v1.16.0/src/snowflake/snowpark/functions.py#L678-L704)¶
Returns either the number of non-NULL records for the specified columns, or the total number of records.
Example
>>> df = session.create_dataframe([[1], [None], [3], [4], [None]], schema=["a"]) >>> df.select(count(col("a")).alias("result")).show() ------------ |"RESULT" | ------------ |3 | ------------ >>> df.select(count("*").alias("result")).show() ------------ |"RESULT" | ------------ |5 | ------------