larray.Axis.apply¶
-
Axis.
apply
(self, func)[source]¶ Returns a new axis with the labels transformed by func.
Parameters: - func : callable
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')