pyspark.sql.functions.radians

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

Converts an angle measured in degrees to an approximately equivalent angle measured in radians.

New in version 2.1.0.

Changed in version 3.4.0: Supports Spark Connect.

Parameters
colColumn or str

angle in degrees

Returns
Column

angle in radians, as if computed by java.lang.Math.toRadians()

Examples

>>> df = spark.range(1)
>>> df.select(radians(lit(180))).first()
Row(RADIANS(180)=3.14159...)