def test_mean() : h0 = Histogram(axis=Axis(100, -50, 50)) h1 = Histogram(axis=Axis(100, -50, 50)) for x in xrange(-50, 50) : h0.fill(x + 0.5) if x + 0.5 > 0 : h1.fill(x+0.5) assert h1.mean() == 25. assert h0.mean() == 0
def test_empty_histogram() : h = Histogram(axis=Axis(100,-50, 50)) assert h.entries() == 0. assert h.sigma() == 0 assert h.mean() == 0 assert h.overflow() == 0 assert h.underflow() ==0