pyspark.RDD.mean

RDD.mean() → NumberOrArray[source]

Compute the mean of this RDD’s elements.

Examples

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