File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -408,11 +408,11 @@ def when(condition, value):
408408def log (col , base = math .e ):
409409 """Returns the first argument-based logarithm of the second argument.
410410
411- >>> df.select(log(df.age, 10.0).alias('ten')).collect()
412- [Row(ten=0.30102999566398114), Row(ten=0.6989700043360187) ]
411+ >>> df.select(log(df.age, 10.0).alias('ten')).map(lambda l: round(l.ten, 5)). collect()
412+ [0.30103, 0.69897 ]
413413
414- >>> df.select(log(df.age).alias('e')).collect()
415- [Row(e=0.6931471805597018), Row(e=1.609437912433535) ]
414+ >>> df.select(log(df.age).alias('e')).map(lambda l: round(l.e, 5)). collect()
415+ [0.69315, 1.60944 ]
416416 """
417417 sc = SparkContext ._active_spark_context
418418 jc = sc ._jvm .functions .log (base , _to_java_column (col ))
You can’t perform that action at this time.
0 commit comments