You are viewing documentation about an older version (1.13.0). View latest version

snowflake.snowpark.functions.stddev¶

snowflake.snowpark.functions.stddev(e: Union[Column, str]) → Column[source]¶

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