ln

Devuelve el logaritmo natural del argumento. Soporta Spark Connect.

Para obtener la función SQL de Databricks correspondiente, consulte ln function.

Syntax

from pyspark.databricks.sql import functions as dbf

dbf.ln(col=<col>)

Parámetros

Parámetro Tipo Description
col pyspark.sql.Column o str Columna para la que se va a calcular el logaritmo.

Devoluciones

pyspark.sql.Column: logaritmo natural del valor especificado.

Examples

from pyspark.databricks.sql import functions as dbf
spark.range(10).select("*", dbf.ln('id')).show()
+---+------------------+
| id|            ln(id)|
+---+------------------+
|  0|              NULL|
|  1|               0.0|
|  2|0.6931471805599...|
|  3|1.0986122886681...|
|  4|1.3862943611198...|
|  5|1.6094379124341...|
|  6| 1.791759469228...|
|  7|1.9459101490553...|
|  8|2.0794415416798...|
|  9|2.1972245773362...|
+---+------------------+