xarray.IndexVariable.roll

IndexVariable.roll(shifts=None, **shifts_kwargs)

Return a new Variable with rolld data.

Parameters
  • shifts (mapping of hashable to int) – Integer offset to roll along each of the given dimensions. Positive offsets roll to the right; negative offsets roll to the left.

  • **shifts_kwargs – The keyword arguments form of shifts. One of shifts or shifts_kwargs must be provided.

Returns

shifted – Variable with the same dimensions and attributes but rolled data.

Return type

Variable