예제 #1
0
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()
예제 #2
0
def test_mean():
    rdd = Context().parallelize([0, 4, 7, 4, 10])
    assert rdd.mean() == 5