larray.IGroup.union

IGroup.union(other) LSet

Return (set) union of this label group and other.

Labels relative order will be kept intact, but only unique labels will be returned. Labels from this group will be before labels from other.

Parameters
otherGroup or any sequence of labels

other labels

Returns
LSet

Examples

>>> from larray import Axis
>>> a = Axis('a=a0..a2')
>>> a['a0', 'a1'].union(a['a1', 'a2'])
a['a0', 'a1', 'a2'].set()
>>> a['a0', 'a1'].union('a1,a2')
a['a0', 'a1', 'a2'].set()
>>> a['a0', 'a1'].union(['a1', 'a2'])
a['a0', 'a1', 'a2'].set()