We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 76fc8de commit ab51542Copy full SHA for ab51542
python/pyspark/sql/functions.py
@@ -416,11 +416,11 @@ def log(arg1, arg2=None):
416
>>> df.select(log(df.age).alias('e')).map(lambda l: str(l.e)[:7]).collect()
417
['0.69314', '1.60943']
418
"""
419
- if arg2 is None:
420
- arg2 = arg1
421
- arg1 = math.e
422
sc = SparkContext._active_spark_context
423
- jc = sc._jvm.functions.log(arg1, _to_java_column(arg2))
+ if arg2 is None:
+ jc = sc._jvm.functions.log(_to_java_column(arg1))
+ else:
+ jc = sc._jvm.functions.log(arg1, _to_java_column(arg2))
424
return Column(jc)
425
426
0 commit comments