snowflake.snowpark.functions.avg¶
- snowflake.snowpark.functions.avg(e: ColumnOrName) Column [source] (https://github.com/snowflakedb/snowpark-python/blob/release-v1.3.0/src/snowflake/snowpark/functions.py#L517-L532)¶
Returns the average of non-NULL records. If all records inside a group are NULL, the function returns NULL.
- Example::
>>> df = session.create_dataframe([[1], [2], [2]], schema=["d"]) >>> df.select(avg(df.d).alias("result")).show() ------------ |"RESULT" | ------------ |1.666667 | ------------