def take_nd(self, indexer, allow_fill=True, fill_value=None):

        # filling must always be None/nan here
        # but is passed thru internally
        assert isnull(fill_value)

        codes = take_1d(self._codes, indexer, allow_fill=True, fill_value=-1)
        result = Categorical(codes, categories=self.categories,
                             ordered=self.ordered, fastpath=True)
        return result
Take the codes by the indexer, fill with the fill_value.
dataset/ETHPy150Open pydata/pandas/pandas/core/categorical.py/Categorical.take_nd