pyspark.sql.functions.stddev_samp#

pyspark.sql.functions.stddev_samp(col)[source]#

Aggregate function: returns the unbiased sample standard deviation of the expression in a group.

New in version 1.6.0.

Changed in version 3.4.0: Supports Spark Connect.

Parameters
colColumn or str

target column to compute on.

Returns
Column

standard deviation of given column.

Examples

>>> import pyspark.sql.functions as sf
>>> spark.range(6).select(sf.stddev_samp("id")).show()
+------------------+
|   stddev_samp(id)|
+------------------+
|1.8708286933869...|
+------------------+