snowflake.snowpark.functions.count¶
- snowflake.snowpark.functions.count(e: Union[Column, str]) Column [source] (https://github.com/snowflakedb/snowpark-python/blob/v1.26.0/snowpark-python/src/snowflake/snowpark/functions.py#L828-L860)¶
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 | ------------