def _maybe_coerce_indexer(self, indexer):
        if isinstance(indexer, np.ndarray) and indexer.dtype.kind == 'i':
            indexer = indexer.astype(self._codes.dtype)
        return indexer
return an indexer coerced to the codes dtype
dataset/ETHPy150Open pydata/pandas/pandas/core/categorical.py/Categorical._maybe_coerce_indexer