larray.LGroup.union

LGroup.union(self, other)

Returns (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()