acosh
Computes the inverse hyperbolic cosine (also known as arcosh) of the given column or expression. Supports Spark Connect.
For the corresponding Databricks SQL function, see acosh function.
Syntax
Python
from pyspark.databricks.sql import functions as dbf
dbf.acosh(col=<col>)
Parameters
Parameter | Type | Description |
|---|---|---|
|
| The target column or expression to compute the inverse hyperbolic cosine on. |
Returns
pyspark.sql.Column: A new column object representing the inverse hyperbolic cosine of the input.
Examples
Python
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([(1,), (2,)], ["value"])
df.select("*", dbf.acosh(df.value)).show()
Output
+-----+------------------+
|value| ACOSH(value)|
+-----+------------------+
| 1| 0.0|
| 2|1.3169578969248...|
+-----+------------------+
Python
from pyspark.databricks.sql import functions as dbf
spark.sql(
"SELECT * FROM VALUES (-0.5), (0.5), (NULL) AS TAB(value)"
).select("*", dbf.acosh("value")).show()
Output
+-----+------------+
|value|ACOSH(value)|
+-----+------------+
| -0.5| NaN|
| 0.5| NaN|
| NULL| NULL|
+-----+------------+