def test_bin_labels(self):
# constructor
cnt = Counter()
for i in range(10):
cnt[i*2] = i
vc = ValueCounts(key='x', counts=cnt)
bin_specs = { 'bin_width': 1, 'bin_offset': 0 }
h = Histogram(vc, variable='x', bin_specs = bin_specs)
bin_labels = [0, 2, 4, 6, 8, 10, 12, 14, 16, 18]
h_bin_labels = h.bin_labels()
self.assertIsInstance(h_bin_labels, np.ndarray)
self.assertListEqual(h_bin_labels.tolist(), bin_labels)
评论列表
文章目录