snowflake.snowpark.functions.stddev

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

Returns the sample standard deviation (square root of sample variance) of non-NULL values. If all records inside a group are NULL, returns NULL.

Example::
>>> from snowflake.snowpark.types import DecimalType
>>> df = session.create_dataframe(
...     [4, 9],
...     schema=["N"],
... ).select(stddev(col("N")).cast(DecimalType(scale=4)))
>>> df.collect()
[Row(CAST (STDDEV("N") AS NUMBER(38, 4))=Decimal('3.5355'))]
Copy
语言: 中文