larray.AxisCollection.get_all

AxisCollection.get_all(key) AxisCollection[source]

Return all axes from key if present and length 1 wildcard axes otherwise.

Parameters
keyAxisCollection
Returns
AxisCollection
Raises
AssertionError

Raised if the input key is not an AxisCollection object.

Examples

>>> age = Axis(range(20), 'age')
>>> sex = Axis('sex=M,F')
>>> time = Axis([2007, 2008, 2009, 2010], 'time')
>>> city = Axis(['London', 'Paris', 'Rome'], 'city')
>>> col = AxisCollection([age, sex, time])
>>> col2 = AxisCollection([age, city, time])
>>> col.get_all(col2)
AxisCollection([
    Axis([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], 'age'),
    Axis(1, 'city'),
    Axis([2007, 2008, 2009, 2010], 'time')
])