예제 #1
0
    def test_infer_series(self):
        c0 = strconv.infer_series(['+0.4', '1.0', '0.'])
        self.assertEqual(c0.most_common(), [('float', 3)])
        self.assertEqual(c0.types['float'].freq(), 1.0)
        self.assertEqual(c0.types['float'].count, 3)
        self.assertEqual(c0.types['float'].size, 10)  # default size

        self.assertEqual(strconv.infer_series([]), None)
예제 #2
0
 def test_infer_series_n(self):
     c0 = strconv.infer_series(['+0.4', '1.0', '0.'], n=1)
     self.assertEqual(c0.most_common(), [('float', 1)])
     self.assertEqual(c0.types['float'].count, 1)