pyspark.sql.functions.exp#

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

Computes the exponential of the given value.

New in version 1.4.0.

Changed in version 3.4.0: Supports Spark Connect.

Parameters
colColumn or str

column to calculate exponential for.

Returns
Column

exponential of the given value.

Examples

>>> df = spark.range(1)
>>> df.select(exp(lit(0))).show()
+------+
|EXP(0)|
+------+
|   1.0|
+------+