pyspark.sql.functions.
pow
Returns the value of the first argument raised to the power of the second argument.
New in version 1.4.0.
Changed in version 3.4.0: Supports Spark Connect.
Column
the base number.
the exponent number.
the base rased to the power the argument.
Examples
>>> df = spark.range(1) >>> df.select(pow(lit(3), lit(2))).first() Row(POWER(3, 2)=9.0)