pyspark.sql.functions.acos

pyspark.sql.functions.acos(col: ColumnOrName) → pyspark.sql.column.Column[source]

Computes inverse cosine of the input column.

New in version 1.4.0.

Changed in version 3.4.0: Supports Spark Connect.

Parameters
colColumn or str

target column to compute on.

Returns
Column

inverse cosine of col, as if computed by java.lang.Math.acos()

Examples

>>> df = spark.range(1, 3)
>>> df.select(acos(df.id)).show()
+--------+
|ACOS(id)|
+--------+
|     0.0|
|     NaN|
+--------+