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([]), [])
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)])