Skip to content

Conversation

@matthew-brett
Copy link
Collaborator

@matthew-brett matthew-brett commented Jun 1, 2016

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)

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)
@matthew-brett
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant