var_pop
Returns the population variance of the values in a group.
Syntax
Python
from pyspark.sql import functions as sf
sf.var_pop(col)
Parameters
Parameter | Type | Description |
|---|---|---|
|
| Target column to compute on. |
Returns
pyspark.sql.Column: variance of given column.
Examples
Python
from pyspark.sql import functions as sf
df = spark.range(6)
df.select(sf.var_pop(df.id)).show()
Output
+------------------+
| var_pop(id)|
+------------------+
|2.9166666666666...|
+------------------+