pyspark.sql.functions.
cos
Computes cosine of the input column.
New in version 1.4.0.
Changed in version 3.4.0: Supports Spark Connect.
Column
angle in radians
cosine of the angle, as if computed by java.lang.Math.cos().
Examples
>>> import math >>> df = spark.range(1) >>> df.select(cos(lit(math.pi))).first() Row(COS(3.14159...)=-1.0)