larray.LArray.shift

LArray.shift(axis, n=1)[source]

Shifts the cells of the array n-times to the left along axis.

Parameters:

axis : int, str or Axis

Axis for which we want to perform the shift.

n : int

Number of cells to shift.

Returns:

LArray

Examples

>>> a = ndrange('sex=M,F;type=type1,type2,type3')
>>> a
sex\type  type1  type2  type3
       M      0      1      2
       F      3      4      5
>>> a.shift(X.type)
sex\type  type2  type3
       M      0      1
       F      3      4
>>> a.shift(X.type, n=-1)
sex\type  type1  type2
       M      1      2
       F      4      5