larray.Axis.i

Axis.i

Allows to define a subset using positions along the axis instead of labels.

Examples

>>> from larray import ndtest
>>> sex = Axis('sex=M,F')
>>> time = Axis([2007, 2008, 2009, 2010], 'time')
>>> arr = ndtest([sex, time])
>>> arr
sex\time  2007  2008  2009  2010
       M     0     1     2     3
       F     4     5     6     7
>>> arr[time.i[0, -1]]
sex\time  2007  2010
       M     0     3
       F     4     7