pyspark.sql.functions.sec#

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

Computes secant 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

Secant of the angle.

Examples

>>> df = spark.range(1)
>>> df.select(sec(lit(1.5))).first()
Row(SEC(1.5)=14.13683...)