Ejemplo n.º 1
0
    def test_infer_matrix(self):
        c0, c1, c2 = strconv.infer_matrix([['+0.4', 'true', '50']])
        self.assertEqual(c0.most_common(), [('float', 1)])
        self.assertEqual(c0.types['float'].freq(), 1.0)
        self.assertEqual(c0.size, 10)  # default size

        self.assertEqual(strconv.infer_matrix([]), [])
Ejemplo n.º 2
0
 def test_infer_matrix_n(self):
     c0, c1, c2 = strconv.infer_matrix([
         ['+0.4', 'true', '50'],
         ['+0.3', 'f', '0'],
     ],
                                       n=1)
     self.assertEqual(c0.most_common(), [('float', 1)])
Ejemplo n.º 3
0
 def test_infer_matrix_n(self):
     c0, c1, c2 = strconv.infer_matrix([
         ['+0.4', 'true', '50'],
         ['+0.3', 'f', '0'],
     ], n=1)
     self.assertEqual(c0.most_common(), [('float', 1)])