pyspark.sql.functions.log10#
- pyspark.sql.functions.log10(col)[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
- col
Column
or str column to calculate logarithm for.
- col
- 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| +----------+