Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
Alias for var_samp
Syntax
from pyspark.sql import functions as sf
sf.variance(col)
Parameters
| Parameter | Type | Description |
|---|---|---|
col |
pyspark.sql.Column or column name |
Target column to compute on. |
Returns
pyspark.sql.Column: variance of given column.
Examples
from pyspark.sql import functions as sf
df = spark.range(6)
df.select(sf.variance(df.id)).show()
+------------+
|variance(id)|
+------------+
| 3.5|
+------------+