pyspark.RDD.mean

RDD.mean() → NumberOrArray

Compute the mean of this RDD’s elements.

Examples

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