RDD.
meanApprox
Approximate operation to return the mean within a timeout or meet the confidence.
New in version 1.2.0.
maximum time to wait for the job, in milliseconds
the desired statistical confidence in the result
BoundedFloat
a potentially incomplete result, with error bounds
See also
RDD.mean()
Examples
>>> rdd = sc.parallelize(range(1000), 10) >>> r = sum(range(1000)) / 1000.0 >>> abs(rdd.meanApprox(1000) - r) / r < 0.05 True