pyspark.sql.functions.degrees#

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

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

New in version 2.1.0.

Changed in version 3.4.0: Supports Spark Connect.

Parameters
colColumn or str

angle in radians

Returns
Column

angle in degrees, as if computed by java.lang.Math.toDegrees()

Examples

>>> from pyspark.sql import functions as sf
>>> spark.range(1).select(sf.degrees(sf.pi())).show()
+-------------+
|DEGREES(PI())|
+-------------+
|        180.0|
+-------------+