Notiz
Zougrëff op dës Säit erfuerdert Autorisatioun. Dir kënnt probéieren, Iech unzemellen oder Verzeechnesser ze änneren.
Zougrëff op dës Säit erfuerdert Autorisatioun. Dir kënnt probéieren, Verzeechnesser ze änneren.
Converts an angle measured in degrees to an approximately equivalent angle measured in radians. Supports Spark Connect.
For the corresponding Databricks SQL function, see radians function.
Syntax
from pyspark.sql import functions as dbf
dbf.radians(col=<col>)
Parameters
| Parameter | Type | Description |
|---|---|---|
col |
pyspark.sql.Column or column name |
angle in degrees |
Returns
pyspark.sql.Column: angle in radians, as if computed by java.lang.Math.toRadians()
Examples
from pyspark.sql import functions as dbf
spark.sql(
"SELECT * FROM VALUES (180), (90), (45), (0) AS TAB(value)"
).select("*", dbf.radians("value")).show()
+-----+------------------+
|value| RADIANS(value)|
+-----+------------------+
| 180| 3.141592653589...|
| 90|1.5707963267948...|
| 45|0.7853981633974...|
| 0| 0.0|
+-----+------------------+