Example #1
0
    def test_na_flags_int_levels(self):
        # #1457

        levels = range(10)
        labels = np.random.randint(0, 10, 20)
        labels[::5] = -1

        cat = Categorical(labels, levels)
        repr(cat)

        self.assert_(np.array_equal(com.isnull(cat), labels == -1))
Example #2
0
    def test_constructor_unsortable(self):
        arr = np.array([1, 2, 3, datetime.now()], dtype='O')

        # it works!
        factor = Categorical.from_array(arr)
Example #3
0
    def test_constructor_unsortable(self):
        arr = np.array([1, 2, 3, datetime.now()], dtype='O')

        # it works!
        factor = Categorical.from_array(arr)
Example #4
0
 def setUp(self):
     self.factor = Categorical.from_array(
         ['a', 'b', 'b', 'a', 'a', 'c', 'c', 'c'])
Example #5
0
 def setUp(self):
     self.factor = Categorical.from_array(['a', 'b', 'b', 'a',
                                      'a', 'c', 'c', 'c'])