larray.Axis.apply

Axis.apply(func) Axis[source]

Return a new axis with the labels transformed by func.

Parameters
funccallable

A callable which takes a single argument and returns a single value.

Returns
Axis

a new Axis with the transformed labels.

Examples

>>> sex = Axis('sex=MALE,FEMALE')
>>> sex.apply(str.capitalize)
Axis(['Male', 'Female'], 'sex')