Note
Ang pag-access sa pahinang ito ay nangangailangan ng pahintulot. Maaari mong subukang mag-sign in o magpalit ng mga direktoryo.
Ang pag-access sa pahinang ito ay nangangailangan ng pahintulot. Maaari mong subukang baguhin ang mga direktoryo.
Computes cosecant of the input column. Supports Spark Connect.
For the corresponding Databricks SQL function, see csc function.
Syntax
from pyspark.databricks.sql import functions as dbf
dbf.csc(col=<col>)
Parameters
| Parameter | Type | Description |
|---|---|---|
col |
pyspark.sql.Column or column name |
angle in radians. |
Returns
pyspark.sql.Column: cosecant of the angle.
Examples
from pyspark.databricks.sql import functions as dbf
spark.sql("SELECT * FROM VALUES (PI() / 2), (PI() / 4) AS TAB(value)").select("*", dbf.csc("value")).show()
+------------------+------------------+
| value| CSC(value)|
+------------------+------------------+
|1.5707963267948...| 1.0|
|0.7853981633974...|1.4142135623730...|
+------------------+------------------+
from pyspark.databricks.sql import functions as dbf
spark.sql("SELECT * FROM VALUES (0.0), (FLOAT('NAN')), (NULL) AS TAB(value)").select("*", dbf.csc("value")).show()
+-----+----------+
|value|CSC(value)|
+-----+----------+
| 0.0| Infinity|
| NaN| NaN|
| NULL| NULL|
+-----+----------+