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