Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Computes inverse sine of the input column. Supports Spark Connect.
For the corresponding Databricks SQL function, see asin function.
Syntax
from pyspark.databricks.sql import functions as dbf
dbf.asin(col=<col>)
Parameters
| Parameter | Type | Description |
|---|---|---|
col |
pyspark.sql.Column or column name |
target column to compute on. |
Returns
pyspark.sql.Column: inverse sine of col, as if computed by java.lang.Math.asin()
Examples
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()
+-----+-------------------+
|value| ASIN(value)|
+-----+-------------------+
| -0.5|-0.5235987755982...|
| 0.0| 0.0|
| 0.5| 0.5235987755982...|
+-----+-------------------+
from pyspark.databricks.sql import functions as dbf
spark.sql("SELECT * FROM VALUES (-2), (2), (NULL) AS TAB(value)").select("*", dbf.asin("value")).show()
+-----+-----------+
|value|ASIN(value)|
+-----+-----------+
| -2| NaN|
| 2| NaN|
| NULL| NULL|
+-----+-----------+