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

Method roll

xarray/core/indexes.py:393–416  ·  view source on GitHub ↗

Roll this index by an offset along one or more dimensions. This method can be re-implemented in subclasses of Index, e.g., when the index can be itself indexed. If not re-implemented, this method returns ``None``, i.e., calling :py:meth:`Dataset.roll` will either dr

(self, shifts: Mapping[Any, int])

Source from the content-addressed store, hash-verified

391 raise NotImplementedError()
392
393 def roll(self, shifts: Mapping[Any, int]) -> Self | None:
394 """Roll this index by an offset along one or more dimensions.
395
396 This method can be re-implemented in subclasses of Index, e.g., when the
397 index can be itself indexed.
398
399 If not re-implemented, this method returns ``None``, i.e., calling
400 :py:meth:`Dataset.roll` will either drop the index in the resulting
401 dataset or pass it unchanged if its corresponding coordinate(s) are not
402 rolled.
403
404 Parameters
405 ----------
406 shifts : mapping of hashable to int, optional
407 A dict with keys matching dimensions and values given
408 by integers to rotate each of the given dimensions, as passed
409 :py:meth:`Dataset.roll`.
410
411 Returns
412 -------
413 rolled : Index
414 A new index with rolled data.
415 """
416 return None
417
418 def rename(
419 self,

Callers 5

to_indexMethod · 0.45
test_rollMethod · 0.45
test_rollMethod · 0.45
test_rollMethod · 0.45
test_roll_consistencyMethod · 0.45

Calls

no outgoing calls

Tested by 4

test_rollMethod · 0.36
test_rollMethod · 0.36
test_rollMethod · 0.36
test_roll_consistencyMethod · 0.36