pyspark.sql.functions.sqrt¶
-
pyspark.sql.functions.
sqrt
(col: ColumnOrName) → pyspark.sql.column.Column[source]¶ Computes the square root of the specified float value.
New in version 1.3.0.
Changed in version 3.4.0: Supports Spark Connect.
Examples
>>> df = spark.range(1) >>> df.select(sqrt(lit(4))).show() +-------+ |SQRT(4)| +-------+ | 2.0| +-------+