Exemplo n.º 1
0
 def test_one(self):
     """
     A single data point is put into a bucket equal to its value and returned.
     """
     dataset = [5.0]
     expected = [(5.0, [5.0])]
     self.assertEqual(quantize(dataset), expected)
Exemplo n.º 2
0
 def test_two(self):
     """
     Each of two values are put into buckets the size of the
     standard deviation of the sample.
     """
     dataset = [2.0, 5.0]
     expected = [(1.5, [2.0]), (4.5, [5.0])]
     self.assertEqual(quantize(dataset), expected)