Beispiel #1
0
 def test_fold_with_enum_index_with_list(self):
     xtypes = [FLOAT, (ENUM, 2)]
     expected = [[1.5, 1]]
     x = np.array([1.5, 0, 1])
     self.assertListEqual(expected, fold_with_enum_index(xtypes, x).tolist())
     x = [1.5, 0, 1]
     self.assertListEqual(expected, fold_with_enum_index(xtypes, x).tolist())
Beispiel #2
0
 def test_fold_with_enum_index(self):
     xtypes = [FLOAT, (ENUM, 2)]
     x = np.array([[1.5, 0, 1], [1.5, 1, 0], [1.5, 0, 1]])
     expected = [[1.5, 1], [1.5, 0], [1.5, 1]]
     self.assertListEqual(expected, fold_with_enum_index(xtypes, x).tolist())