pyspark.sql.functions.cot#

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

Computes cotangent of the input column.

New in version 3.3.0.

Changed in version 3.4.0: Supports Spark Connect.

Parameters
colColumn or str

angle in radians.

Returns
Column

cotangent of the angle.

Examples

>>> from pyspark.sql import functions as sf
>>> spark.range(1).select(sf.cot(sf.pi() / 4)).show()
+------------------+
|   COT((PI() / 4))|
+------------------+
|1.0000000000000...|
+------------------+