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.
Returns the unbiased sample variance of the values in a group.
Syntax
from pyspark.sql import functions as sf
sf.var_samp(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.var_samp(df.id)).show()
+------------+
|var_samp(id)|
+------------+
| 3.5|
+------------+