หมายเหตุ
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลอง ลงชื่อเข้าใช้หรือเปลี่ยนไดเรกทอรีได้
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลองเปลี่ยนไดเรกทอรีได้
Computes inverse hyperbolic sine of the input column. Supports Spark Connect.
For the corresponding Databricks SQL function, see asinh function.
Syntax
from pyspark.databricks.sql import functions as dbf
dbf.asinh(col=<col>)
Parameters
| Parameter | Type | Description |
|---|---|---|
col |
pyspark.sql.Column or column name |
target column to compute on. |
Returns
pyspark.sql.Column: the column for computed results.
Examples
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([(-0.5,), (0.0,), (0.5,)], ["value"])
df.select("*", dbf.asinh(df.value)).show()
+-----+--------------------+
|value| ASINH(value)|
+-----+--------------------+
| -0.5|-0.48121182505960...|
| 0.0| 0.0|
| 0.5| 0.48121182505960...|
+-----+--------------------+
from pyspark.databricks.sql import functions as dbf
spark.sql(
"SELECT * FROM VALUES (FLOAT('NAN')), (NULL) AS TAB(value)"
).select("*", dbf.asinh("value")).show()
+-----+------------+
|value|ASINH(value)|
+-----+------------+
| NaN| NaN|
| NULL| NULL|
+-----+------------+