pyspark.sql.functions.cot

pyspark.sql.functions.cot(col: ColumnOrName) → pyspark.sql.column.Column[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

>>> import math
>>> df = spark.range(1)
>>> df.select(cot(lit(math.radians(45)))).first()
Row(COT(0.78539...)=1.00000...)