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.
Returns the value. Supports Spark Connect.
For the corresponding Databricks SQL function, see positive function.
Syntax
from pyspark.sql import functions as dbf
dbf.positive(col=<col>)
Parameters
| Parameter | Type | Description |
|---|---|---|
col |
pyspark.sql.Column or column name |
input value column. |
Returns
pyspark.sql.Column: value.
Examples
from pyspark.sql import functions as dbf
df = spark.createDataFrame([(-1,), (0,), (1,)], ["value"])
df.select("*", dbf.positive(df.value)).show()
+-----+---------+
|value|(+ value)|
+-----+---------+
| -1| -1|
| 0| 0|
| 1| 1|
+-----+---------+