pyspark.RDD.mean

RDD.mean() → float[source]

Compute the mean of this RDD’s elements.

New in version 0.9.1.

Returns
float

the mean of all elements

Examples

>>> sc.parallelize([1, 2, 3]).mean()
2.0