def test_doubles(self): series = range(6) series.reverse() binned = b.abin(series, 2) self.assertEqual(binned, [4.5, 3.5, 2.5, 1.5, 0.5])
def test_quads(self): series = [3*i for i in range(7)] binned = b.abin(series, 4) self.assertEqual(binned, [4.5, 7.5, 10.5, 13.5])
def test_singletons(self): series = [random.random() for i in range(10)] binned = b.abin(series, 1) self.assertEqual(binned, series)