Esempio n. 1
0
 def test_remap_label_indexers(self):
     # TODO: fill in more tests!
     data = Dataset({'x': ('x', [1, 2, 3])})
     test_indexer = lambda x: indexing.remap_label_indexers(data, {'x': x})
     self.assertEqual({'x': 0}, test_indexer(1))
     self.assertEqual({'x': 0}, test_indexer(np.int32(1)))
     self.assertEqual({'x': 0}, test_indexer(Variable([], 1)))
Esempio n. 2
0
 def test_remap_label_indexers(self):
     # TODO: fill in more tests!
     data = Dataset({'x': ('x', [1, 2, 3])})
     test_indexer = lambda x: indexing.remap_label_indexers(data, {'x': x})
     self.assertEqual({'x': 0}, test_indexer(1))
     self.assertEqual({'x': 0}, test_indexer(np.int32(1)))
     self.assertEqual({'x': 0}, test_indexer(Variable([], 1)))
Esempio n. 3
0
 def test_indexer(x):
     return indexing.remap_label_indexers(data, {'x': x})