pyspark.sql.functions.positive

pyspark.sql.functions.positive(col: ColumnOrName) → pyspark.sql.column.Column[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|
+---+