roll
- UnitsAwareDataArray.roll(shifts: Mapping[Hashable, int] | None = None, roll_coords: bool = False, **shifts_kwargs: int) Self
- Roll this array by an offset along one or more dimensions. - Unlike shift, roll treats the given dimensions as periodic, so will not create any missing values to be filled. - Unlike shift, roll may rotate all variables, including coordinates if specified. The direction of rotation is consistent with - numpy.roll().- Parameters:
- shifts (mapping of Hashable to int, optional) – Integer offset to rotate each of the given dimensions. Positive offsets roll to the right; negative offsets roll to the left. 
- roll_coords (bool, default: False) – Indicates whether to roll the coordinates by the offset too. 
- **shifts_kwargs ({dim: offset, ...}, optional) – The keyword arguments form of - shifts. One of shifts or shifts_kwargs must be provided.
 
- Returns:
- rolled – DataArray with the same attributes but rolled data and coordinates. 
- Return type:
- DataArray 
 - See also - Examples - >>> arr = xr.DataArray([5, 6, 7], dims="x") >>> arr.roll(x=1) <xarray.DataArray (x: 3)> Size: 24B array([7, 5, 6]) Dimensions without coordinates: x