def setup(self):
    N = (10 ** 5)
    ncats = 100
    self.s_str = pd.Series(tm.makeCategoricalIndex(N, ncats)).astype(str)
    self.s_str_cat = self.s_str.astype('category')
    with warnings.catch_warnings(record=True):
        self.s_str_cat_ordered = self.s_str.astype('category', ordered=True)
    self.s_int = pd.Series(np.random.randint(0, ncats, size=N))
    self.s_int_cat = self.s_int.astype('category')
    with warnings.catch_warnings(record=True):
        self.s_int_cat_ordered = self.s_int.astype('category', ordered=True)
def setup(self):
    N = (10 ** 5)
    ncats = 100
    self.s_str = pd.Series(tm.makeCategoricalIndex(N, ncats)).astype(str)
    self.s_str_cat = self.s_str.astype('category')
    with warnings.catch_warnings(record=True):
        self.s_str_cat_ordered = self.s_str.astype('category', ordered=True)
    self.s_int = pd.Series(np.random.randint(0, ncats, size=N))
    self.s_int_cat = self.s_int.astype('category')
    with warnings.catch_warnings(record=True):
        self.s_int_cat_ordered = self.s_int.astype('category', ordered=True)