def test_stats(): d = [1, 4, 9, 16, 25, 36] s = Context().parallelize(d, 3).stats() print(s.mean()) print(sum(d)/len(d)) assert sum(d)/len(d) == s.mean()
def test_mean(): rdd = Context().parallelize([0, 4, 7, 4, 10]) assert rdd.mean() == 5