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

Method roll

xarray/core/indexes.py:931–939  ·  view source on GitHub ↗
(self, shifts: Mapping[Any, int])

Source from the content-addressed store, hash-verified

929 return {self.dim: get_indexer_nd(self.index, other.index, method, tolerance)}
930
931 def roll(self, shifts: Mapping[Any, int]) -> PandasIndex:
932 shift = shifts[self.dim] % self.index.shape[0]
933
934 if shift != 0:
935 new_pd_idx = self.index[-shift:].append(self.index[:-shift])
936 else:
937 new_pd_idx = self.index[:]
938
939 return self._replace(new_pd_idx)
940
941 def rename(self, name_dict, dims_dict):
942 if self.index.name not in name_dict and self.dim not in dims_dict:

Callers

nothing calls this directly

Calls 1

_replaceMethod · 0.95

Tested by

no test coverage detected