code: def _maybe_coerce_indexer(self, indexer):
          
          if isinstance(indexer, np.ndarray) and indexer.dtype.kind == 'i':
              indexer = indexer.astype(self._codes.dtype)
          return indexer
docs: return an indexer coerced to the codes dtype