Return False if indexer is an int, slice, a 1-dimensional list, or a 0 or 1-dimensional ndarray; in all other cases return True
(indexer: Any)
| 1667 | |
| 1668 | |
| 1669 | def is_fancy_indexer(indexer: Any) -> bool: |
| 1670 | """Return False if indexer is an int, slice, a 1-dimensional list, or a 0 or |
| 1671 | 1-dimensional ndarray; in all other cases return True |
| 1672 | """ |
| 1673 | if isinstance(indexer, int | slice) and not isinstance(indexer, bool): |
| 1674 | return False |
| 1675 | if isinstance(indexer, np.ndarray): |
| 1676 | return indexer.ndim > 1 |
| 1677 | if isinstance(indexer, list): |
| 1678 | return bool(indexer) and not isinstance(indexer[0], int) |
| 1679 | return True |
| 1680 | |
| 1681 | |
| 1682 | class NumpyIndexingAdapter(IndexingAdapter): |