larray.Axis.align

Axis.align(other, join='outer') Axis[source]

Align axis with other object using specified join method.

Parameters
otherAxis or label sequence
join{‘outer’, ‘inner’, ‘left’, ‘right’, ‘exact’}, optional

Defaults to ‘outer’.

Returns
Axis

Aligned axis

See also

Array.align

Examples

>>> axis1 = Axis('a=a0..a2')
>>> axis2 = Axis('a=a1..a3')
>>> axis1.align(axis2)
Axis(['a0', 'a1', 'a2', 'a3'], 'a')
>>> axis1.align(axis2, join='inner')
Axis(['a1', 'a2'], 'a')
>>> axis1.align(axis2, join='left')
Axis(['a0', 'a1', 'a2'], 'a')
>>> axis1.align(axis2, join='right')
Axis(['a1', 'a2', 'a3'], 'a')
>>> axis1.align(axis2, join='exact')   
Traceback (most recent call last):
...
ValueError: align method with join='exact' expected
Axis(['a0', 'a1', 'a2'], 'a') to be equal to Axis(['a1', 'a2', 'a3'], 'a')