pyspark.sql.functions.tanh#

pyspark.sql.functions.tanh(col)[source]#

Computes hyperbolic tangent of the input column.

New in version 1.4.0.

Changed in version 3.4.0: Supports Spark Connect.

Parameters
colColumn or str

hyperbolic angle

Returns
Column

hyperbolic tangent of the given value as if computed by java.lang.Math.tanh()

Examples

>>> from pyspark.sql import functions as sf
>>> spark.range(1).select(sf.tanh(sf.pi() / 2)).show()
+------------------+
|  TANH((PI() / 2))|
+------------------+
|0.9171523356672744|
+------------------+