הערה
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות להיכנס או לשנות מדריכי כתובות.
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות לשנות מדריכי כתובות.
Computes the natural logarithm of the given value plus one. Supports Spark Connect.
For the corresponding Databricks SQL function, see log1p function.
Syntax
from pyspark.sql import functions as dbf
dbf.log1p(col=<col>)
Parameters
| Parameter | Type | Description |
|---|---|---|
col |
pyspark.sql.Column or column name |
column to calculate natural logarithm for. |
Returns
pyspark.sql.Column: natural logarithm of the "given value plus one".
Examples
from pyspark.sql import functions as dbf
spark.range(1).select(dbf.log1p(dbf.e())).show()
+------------------+
| LOG1P(E())|
+------------------+
|1.3132616875182...|
+------------------+
from pyspark.sql import functions as dbf
spark.range(1).select(dbf.log(dbf.e() + 1)).show()
+------------------+
| ln((E() + 1))|
+------------------+
|1.3132616875182...|
+------------------+