larray.Axis.equals

Axis.equals(self, other)[source]

Checks if self is equal to another axis. Two axes are equal if they have the same name and label(s).

Parameters:
other : Axis

Axis to compare with.

Returns:
bool

True if input axis is equal to self, False otherwise.

Examples

>>> age = Axis(range(5), 'age')
>>> age_2 = Axis(5, 'age')
>>> age_3 = Axis(range(5), 'young children')
>>> age_4 = Axis([0, 1, 2, 3, 4], 'age')
>>> age.equals(age_2)
False
>>> age.equals(age_3)
False
>>> age.equals(age_4)
True