# xarray.Index.roll

#### Index.roll(shifts)[[source]](https://github.com/pydata/xarray/blob/main/xarray/core/indexes.py#L394-L417)

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
[`Dataset.roll()`](xarray.Dataset.roll.html.md#xarray.Dataset.roll) will either drop the index in the resulting
dataset or pass it unchanged if its corresponding coordinate(s) are not
rolled.

* **Parameters:**
  **shifts** ([mapping](https://docs.python.org/3/glossary.html#term-mapping) of [hashable](../user-guide/terminology.html.md#term-name) to [`int`](https://docs.python.org/3/builtins/functions.html#int), *optional*) – A dict with keys matching dimensions and values given
  by integers to rotate each of the given dimensions, as passed
  [`Dataset.roll()`](xarray.Dataset.roll.html.md#xarray.Dataset.roll).
* **Returns:**
  **rolled** ([`Index`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Index.html#pandas.Index)) – A new index with rolled data.
