pyspark.sql.functions.negative¶
-
pyspark.sql.functions.
negative
(col: ColumnOrName) → pyspark.sql.column.Column[source]¶ Returns the negative value.
New in version 3.5.0.
Examples
>>> import pyspark.sql.functions as sf >>> spark.range(3).select(sf.negative("id")).show() +------------+ |negative(id)| +------------+ | 0| | -1| | -2| +------------+