degrés
Convertit un angle mesuré en radians en un angle approximativement équivalent mesuré en degrés. Prend en charge Spark Connect.
Pour la fonction Databricks SQL correspondante, consultez la fonctiondegrees.
Syntaxe
Python
from pyspark.sql import functions as dbf
dbf.degrees(col=<col>)
parameter
parameter | Type | Description |
|---|---|---|
|
| angle en radians |
Renvoie
pyspark.sql.Column: angle en degrés, tel que calculé par java.lang.Math.toDegrees()
Exemples
Python
from pyspark.sql import functions as dbf
spark.sql("SELECT * FROM VALUES (0.0), (PI()), (PI() / 2), (PI() / 4) AS TAB(value)").select("*", dbf.degrees("value")).show()
Output
+------------------+--------------+
| value|DEGREES(value)|
+------------------+--------------+
| 0.0| 0.0|
| 3.141592653589...| 180.0|
|1.5707963267948...| 90.0|
|0.7853981633974...| 45.0|
+------------------+--------------+