pyspark.sql.functions.stddev#

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

Aggregate function: alias for stddev_samp.

New in version 1.6.0.

Changed in version 3.4.0: Supports Spark Connect.

Parameters
colColumn or column name

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("id")).show()
+------------------+
|        stddev(id)|
+------------------+
|1.8708286933869...|
+------------------+