pyspark.sql.functions.positive#

pyspark.sql.functions.positive(col)[source]#

Returns the value.

New in version 3.5.0.

Parameters
colColumn or str

input value column.

Returns
Column

value.

Examples

>>> df = spark.createDataFrame([(-1,), (0,), (1,)], ['v'])
>>> df.select(positive("v").alias("p")).show()
+---+
|  p|
+---+
| -1|
|  0|
|  1|
+---+