MCPcopy Index your code
hub / github.com/pydata/xarray / sel

Method sel

xarray/core/indexes.py:291–315  ·  view source on GitHub ↗

Query the index with arbitrary coordinate label indexers. Implementation is optional but required in order to support label-based selection. Otherwise it will raise an error when trying to call :py:meth:`Dataset.sel` with labels for this index coordinates. Coordinat

(self, labels: dict[Any, Any])

Source from the content-addressed store, hash-verified

289 return None
290
291 def sel(self, labels: dict[Any, Any]) -> IndexSelResult:
292 """Query the index with arbitrary coordinate label indexers.
293
294 Implementation is optional but required in order to support label-based
295 selection. Otherwise it will raise an error when trying to call
296 :py:meth:`Dataset.sel` with labels for this index coordinates.
297
298 Coordinate label indexers can be of many kinds, e.g., scalar, list,
299 tuple, array-like, slice, :py:class:`Variable`, :py:class:`DataArray`, etc.
300 It is the responsibility of the index to handle those indexers properly.
301
302 Parameters
303 ----------
304 labels : dict
305 A dictionary of coordinate label indexers passed from
306 :py:meth:`Dataset.sel` and where the entries have been filtered
307 for the current index.
308
309 Returns
310 -------
311 sel_results : :py:class:`IndexSelResult`
312 An index query result object that contains dimension positional indexers.
313 It may also contain new indexes, coordinate variables, etc.
314 """
315 raise NotImplementedError(f"{self!r} doesn't support label-based selection")
316
317 def join(self, other: Self, how: JoinOptions = "inner") -> Self:
318 """Return a new index from the combination of this index with another

Callers 15

test_outer_indexingFunction · 0.45
test_vectorized_indexingFunction · 0.45
setupMethod · 0.45
convert_calendarFunction · 0.45
__getitem__Method · 0.45
map_index_queriesFunction · 0.45
_iter_over_selectionsFunction · 0.45
np_cov_indFunction · 0.45
np_corr_indFunction · 0.45
test_tree_index_selFunction · 0.45
test_tree_index_renameFunction · 0.45

Calls

no outgoing calls

Tested by 15

test_outer_indexingFunction · 0.36
test_vectorized_indexingFunction · 0.36
np_cov_indFunction · 0.36
np_corr_indFunction · 0.36
test_tree_index_selFunction · 0.36
test_tree_index_renameFunction · 0.36
test_range_index_selFunction · 0.36
test_groupby_getitemFunction · 0.36