Coerce the array-like indexer to the smallest integer dtype that can encode all of the given categories. Parameters ---------- array_like : array-like categories : array-like copy : bool Returns ------- np.ndarray Non-writeable.
(array_like, categories, copy: bool = False)
| 4711 | |
| 4712 | |
| 4713 | def _coerce_indexer_frozen(array_like, categories, copy: bool = False) -> np.ndarray: |
| 4714 | """ |
| 4715 | Coerce the array-like indexer to the smallest integer dtype that can encode all |
| 4716 | of the given categories. |
| 4717 | |
| 4718 | Parameters |
| 4719 | ---------- |
| 4720 | array_like : array-like |
| 4721 | categories : array-like |
| 4722 | copy : bool |
| 4723 | |
| 4724 | Returns |
| 4725 | ------- |
| 4726 | np.ndarray |
| 4727 | Non-writeable. |
| 4728 | """ |
| 4729 | array_like = coerce_indexer_dtype(array_like, categories) |
| 4730 | if copy: |
| 4731 | array_like = array_like.copy() |
| 4732 | array_like.flags.writeable = False |
| 4733 | return array_like |
| 4734 | |
| 4735 | |
| 4736 | def _require_listlike(level, arr, arrname: str): |
no test coverage detected