Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
Computes inverse sine of the input column. Supports Spark Connect.
For the corresponding Databricks SQL function, see asin function.
Syntax
from pyspark.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.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.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|
+-----+-----------+