pyspark.sql.functions.log10

pyspark.sql.functions.log10(col: ColumnOrName) → pyspark.sql.column.Column[source]

Computes the logarithm of the given value in Base 10.

New in version 1.4.0.

Changed in version 3.4.0: Supports Spark Connect.

Parameters
colColumn or str

column to calculate logarithm for.

Returns
Column

logarithm of the given value in Base 10.

Examples

>>> df = spark.range(1)
>>> df.select(log10(lit(100))).show()
+----------+
|LOG10(100)|
+----------+
|       2.0|
+----------+