Ejemplo n.º 1
0
 def test_toFreqs(self):
     """Histogram toFreqs() should return a Freqs object"""
     h = Histogram(list(range(0,20)),bins=[Span(0,3),Span(3,10),
         Span(10,18),Span(18,20)])
     constructor=str
     f = h.toFreqs()
     self.assertEqual(f[constructor(Span(0,3))],3)
     self.assertEqual(f[constructor(Span(3,10))],7)
     self.assertEqual(f[constructor(Span(10,18))],8)
     self.assertEqual(f[constructor(Span(18,20))],2)
Ejemplo n.º 2
0
 def test_toFreqs(self):
     """Histogram toFreqs() should return a Freqs object"""
     h = Histogram(range(0,20),bins=[Span(0,3),Span(3,10),
         Span(10,18),Span(18,20)])
     constructor=str
     f = h.toFreqs()
     self.assertEqual(f[constructor(Span(0,3))],3)
     self.assertEqual(f[constructor(Span(3,10))],7)
     self.assertEqual(f[constructor(Span(10,18))],8)
     self.assertEqual(f[constructor(Span(18,20))],2)