pyspark.sql.functions.radians#
- pyspark.sql.functions.radians(col)[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
- col
Column
or str angle in degrees
- col
- 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...)