diff options
author | Scott Taylor <github@megatron.me.uk> | 2015-06-22 23:37:56 -0700 |
---|---|---|
committer | Josh Rosen <joshrosen@databricks.com> | 2015-06-22 23:37:56 -0700 |
commit | f0dcbe8a7c2de510b47a21eb45cde34777638758 (patch) | |
tree | 59a0ebb92cf3e58d173dd03fae68756974e6eeb4 /python/pyspark/rdd.py | |
parent | 9b618fb0d2536121d2784ff5341d74723e810fc5 (diff) | |
download | spark-f0dcbe8a7c2de510b47a21eb45cde34777638758.tar.gz spark-f0dcbe8a7c2de510b47a21eb45cde34777638758.tar.bz2 spark-f0dcbe8a7c2de510b47a21eb45cde34777638758.zip |
[SPARK-8541] [PYSPARK] test the absolute error in approx doctests
A minor change but one which is (presumably) visible on the public api docs webpage.
Author: Scott Taylor <github@megatron.me.uk>
Closes #6942 from megatron-me-uk/patch-3 and squashes the following commits:
fbed000 [Scott Taylor] test the absolute error in approx doctests
Diffstat (limited to 'python/pyspark/rdd.py')
-rw-r--r-- | python/pyspark/rdd.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/python/pyspark/rdd.py b/python/pyspark/rdd.py index 20c0bc93f4..1b64be23a6 100644 --- a/python/pyspark/rdd.py +++ b/python/pyspark/rdd.py @@ -2198,7 +2198,7 @@ class RDD(object): >>> rdd = sc.parallelize(range(1000), 10) >>> r = sum(range(1000)) - >>> (rdd.sumApprox(1000) - r) / r < 0.05 + >>> abs(rdd.sumApprox(1000) - r) / r < 0.05 True """ jrdd = self.mapPartitions(lambda it: [float(sum(it))])._to_java_object_rdd() @@ -2215,7 +2215,7 @@ class RDD(object): >>> rdd = sc.parallelize(range(1000), 10) >>> r = sum(range(1000)) / 1000.0 - >>> (rdd.meanApprox(1000) - r) / r < 0.05 + >>> abs(rdd.meanApprox(1000) - r) / r < 0.05 True """ jrdd = self.map(float)._to_java_object_rdd() |