larray.Array.i

Array.i

Allows selection of a subset using indices of labels.

Notes

Using .i[] is equivalent to numpy indexing when indexing along a single axis. However, when indexing along multiple axes this indexes the cross product instead of points.

Examples

>>> arr = ndtest((2, 3, 4))
>>> arr
 a  b\c  c0  c1  c2  c3
a0   b0   0   1   2   3
a0   b1   4   5   6   7
a0   b2   8   9  10  11
a1   b0  12  13  14  15
a1   b1  16  17  18  19
a1   b2  20  21  22  23
>>> arr.i[:, 0:2, [0, 2]]
 a  b\c  c0  c2
a0   b0   0   2
a0   b1   4   6
a1   b0  12  14
a1   b1  16  18