Open matthew-brett opened 8 years ago
After this PR, you can do the following two slicing operations, that previously raised errors:
>>> da = DataArray(np.ones((2, 3, 4)), 'abc') >>> da.axes['b'] Axis(name='b', index=1, labels=None) >>> da.axes[1:] (Axis(name='b', index=1, labels=None), Axis(name='c', index=2, labels=None))
Note that, as currently written, these two both return an Axis:
>>> da.axes['b'] Axis(name='b', index=1, labels=None) >>> da.axes('b') Axis(name='b', index=1, labels=None)
Thinking about it - I am ambivalent about this change. It's a bit annoying that there are now two ways to get an axis by name, and you can always to the slicing by iterating over the axes.
axes
After this PR, you can do the following two slicing operations, that previously raised errors:
Note that, as currently written, these two both return an Axis: