Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic label alignment #186

Closed
3 tasks done
shoyer opened this issue Jul 17, 2014 · 1 comment · Fixed by #321
Closed
3 tasks done

Automatic label alignment #186

shoyer opened this issue Jul 17, 2014 · 1 comment · Fixed by #321

Comments

@shoyer
Copy link
Member

shoyer commented Jul 17, 2014

If we want to mimic pandas, we should support automatic alignment of coordinate labels in:

For the later two cases, it is not clear that using an inner join on coordinate labels is the right choice, because that could lead to some surprising destructive operations. This should be considered carefully.

@shoyer
Copy link
Member Author

shoyer commented Feb 9, 2015

I have most of a working implementation for this that will be up for a PR shortly. Here's some of my thinking on expected behavior.

Based on the principle that combining arrays into a new dataset should not remove information, it makes sense to use outer joins for Dataset.__init__ and Dataset.merge. This is the same behavior pandas uses

When adding an item to an existing dataset, it would be surprising if indexes or dimension sizes changed. So I think we should be using left joins for __setitem__ and update. This is also what pandas does.

Right now, we use Dataset.merge to handle all operations that add new items to a dataset. Adding automatic alignment is turning that into even more of a kludgy mess than it already was. I think some simplification of scope for update/__setitem__/merge would help, though I'm not sure it's worth breaking existing code.

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

Successfully merging a pull request may close this issue.

1 participant