MCPcopy
hub / github.com/pydata/xarray / is_fancy_indexer

Function is_fancy_indexer

xarray/core/indexing.py:1669–1679  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

1667
1668
1669def 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
1682class NumpyIndexingAdapter(IndexingAdapter):

Callers 2

iselMethod · 0.90
iselMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…