Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Computes inverse hyperbolic tangent of the input column. Supports Spark Connect.
For the corresponding Databricks SQL function, see atanh function.
Syntax
from pyspark.databricks.sql import functions as dbf
dbf.atanh(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.atanh(df.value)).show()
+-----+-------------------+
|value| ATANH(value)|
+-----+-------------------+
| -0.5|-0.5493061443340...|
| 0.0| 0.0|
| 0.5| 0.5493061443340...|
+-----+-------------------+
from pyspark.databricks.sql import functions as dbf
spark.sql("SELECT * FROM VALUES (-2), (2), (FLOAT('NAN')), (NULL) AS TAB(value)").select("*", dbf.atanh("value")).show()
+-----+------------+
|value|ATANH(value)|
+-----+------------+
| -2.0| NaN|
| 2.0| NaN|
| NaN| NaN|
| NULL| NULL|
+-----+------------+