pyspark.sql.functions.stddev

pyspark.sql.functions.stddev(col: ColumnOrName) → pyspark.sql.column.Column[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 str

target column to compute on.

Returns
Column

standard deviation of given column.

Examples

>>> df = spark.range(6)
>>> df.select(stddev(df.id)).first()
Row(stddev_samp(id)=1.87082...)