larray.Axis.subaxis

Axis.subaxis(self, key, name=None)[source]

Returns an axis for a sub-array.

Parameters
keyint, or collection (list, slice, array, LArray) of them

Indices of labels to use for the new axis.

namestr, optional

Name of the subaxis. Defaults to the name of the parent axis.

Returns
Axis

Subaxis. If key is a None slice and name is None, the original Axis is returned. If key is a LArray, the list of axes is returned.

Examples

>>> age = Axis(range(100), 'age')
>>> age.subaxis(range(10, 19), 'teenagers')
Axis([10, 11, 12, 13, 14, 15, 16, 17, 18], 'teenagers')