asin
Computes inverse sine of the input column. Supports Spark Connect.
For the corresponding Databricks SQL function, see asin function.
Syntax
Python
from pyspark.databricks.sql import functions as dbf
dbf.asin(col=<col>)
Parameters
Parameter | Type | Description |
|---|---|---|
|
| target column to compute on. |
Returns
pyspark.sql.Column: inverse sine of col, as if computed by java.lang.Math.asin()
Examples
Python
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([(-0.5,), (0.0,), (0.5,)], ["value"])
df.select("*", dbf.asin(df.value)).show()
Output
+-----+-------------------+
|value| ASIN(value)|
+-----+-------------------+
| -0.5|-0.5235987755982...|
| 0.0| 0.0|
| 0.5| 0.5235987755982...|
+-----+-------------------+
Python
from pyspark.databricks.sql import functions as dbf
spark.sql("SELECT * FROM VALUES (-2), (2), (NULL) AS TAB(value)").select("*", dbf.asin("value")).show()
Output
+-----+-----------+
|value|ASIN(value)|
+-----+-----------+
| -2| NaN|
| 2| NaN|
| NULL| NULL|
+-----+-----------+