返回组中值的峰态系数。
Syntax
from pyspark.sql import functions as sf
sf.kurtosis(col)
参数
| 参数 | 类型 | Description |
|---|---|---|
col |
pyspark.sql.Column 或列名 |
要计算的目标列。 |
退货
pyspark.sql.Column:给定列的库尔特氏度。
例子
from pyspark.sql import functions as sf
df = spark.createDataFrame([[1],[1],[2]], ["c"])
result = df.select(sf.kurtosis(df.c)).collect()[0][0]
spark.createDataFrame([(result < -1.49 and result > -1.51,)], ["within_expected_range"]).show()
+---------------------+
|within_expected_range|
+---------------------+
| true|
+---------------------+