def _slice(self, slicer):
    ' Return a slice of myself.\n\n        For internal compatibility with numpy arrays.\n        '
    if (isinstance(slicer, tuple) and (len(slicer) == 2)):
        if (not com.is_null_slice(slicer[0])):
            raise AssertionError('invalid slicing for a 1-ndim categorical')
        slicer = slicer[1]
    codes = self._codes[slicer]
    return self._constructor(values=codes, dtype=self.dtype, fastpath=True)
Return a slice of myself.

For internal compatibility with numpy arrays.
def _slice(self, slicer):
    ' Return a slice of myself.\n\n        For internal compatibility with numpy arrays.\n        '
    if (isinstance(slicer, tuple) and (len(slicer) == 2)):
        if (not com.is_null_slice(slicer[0])):
            raise AssertionError('invalid slicing for a 1-ndim categorical')
        slicer = slicer[1]
    codes = self._codes[slicer]
    return self._constructor(values=codes, dtype=self.dtype, fastpath=True)