Skip to main content

asinh

Computes inverse hyperbolic sine of the input column. Supports Spark Connect.

For the corresponding Databricks SQL function, see asinh function.

Syntax

Python
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

Python
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()
Output
+-----+--------------------+
|value| ASINH(value)|
+-----+--------------------+
| -0.5|-0.48121182505960...|
| 0.0| 0.0|
| 0.5| 0.48121182505960...|
+-----+--------------------+

Python
from pyspark.databricks.sql import functions as dbf
spark.sql(
"SELECT * FROM VALUES (FLOAT('NAN')), (NULL) AS TAB(value)"
).select("*", dbf.asinh("value")).show()
Output
+-----+------------+
|value|ASINH(value)|
+-----+------------+
| NaN| NaN|
| NULL| NULL|
+-----+------------+