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))
def test_constructor_unsortable(self): arr = np.array([1, 2, 3, datetime.now()], dtype='O') # it works! factor = Categorical.from_array(arr)
def setUp(self): self.factor = Categorical.from_array( ['a', 'b', 'b', 'a', 'a', 'c', 'c', 'c'])
def setUp(self): self.factor = Categorical.from_array(['a', 'b', 'b', 'a', 'a', 'c', 'c', 'c'])