Axis.split(self, sep='_', names=None, regex=None, return_labels=False)[source]

Split axis and returns a list of Axis.

sepstr, optional

Delimiter to use for splitting. Defaults to ‘_’. When regex is provided, the delimiter is only used on names if given as one string or on axis name if names is None.

namesstr or list of str, optional

Names of resulting axes. Defaults to None.

regexstr, optional

Use regex instead of delimiter to split labels. Defaults to None.

labelsbool, optional

Whether or not split labels must be returned (as a tuple of tuples). These labels are suitable for indexing via array.points[labels]. Defaults to False.

list of Axis or (list of Axis, array-like)


>>> a_b = Axis('a_b=a0_b0,a0_b1,a0_b2,a1_b0,a1_b1,a1_b2')
>>> a_b.split()
[Axis(['a0', 'a1'], 'a'), Axis(['b0', 'b1', 'b2'], 'b')]