-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Allow concat() to drop/replace duplicate index labels? #1072
Comments
Is combine_first already implemented? I can't find it in the source code, neither could I find ops.choose. |
Sorry, nope not implemented yet. |
So I fooled around with Pandas'
and was surprised that the indexes were not "outer-joined". Is this the behavior xarray wants to emulate? As a mockup for |
Indeed, I think we definitely want to do an outer align first. That behavior for pandas looks very strange. |
Here's my somewhat hacky stab at it, not optimized for speed/efficiency:
And the result:
Would this be the behavior we want from xarray's |
Another test:
|
Pandas implements this like: |
I think we should still call it |
Thanks for the reply. Would it make things easier if
|
Use For now, maybe use |
So I spent some time looking at
And it seems to work. My test cases are
and here are the results:
I don't like the fact that I have to access |
Any suggestion on improvement? |
hmm, so what would be an expected behavior of If I have
I get
and changing the order to This is done essentially by adding a |
What about simply adding a keyword argument |
So these are my
Within dataarray.py and dataset.py, Given this construct, I'm not sure how to do the refactor like you mentioned. Perhaps a few more pointers to the right direction? :) |
I suppose I can save one line by getting rid of the duplicate If the behaviors check out, then this branch might be ready for a PR. |
Currently, Either |
Checking in on how to move forward from here...I feel it's pretty close to a PR... |
I would rather wait a little while here -- I think #964 will handle the logic we need to make add a
|
I just merged #964. If you're up for it, I would suggest rewriting Let me know if you need any guidance on using |
Ok I'll give it a shot. Will touch base when I run into roadblocks. |
I'm curious, if you put a |
@chunweiyuan import at the top of the method/ function,
This is the pretty standard way to get around circular imports. There's basically no way to avoid this issue with APIs designed to have lots of logic in method calls. (Other than gigantic files, which isn't a real fix.) |
Fixed by #1204 |
Right now,
Would it be OK to introduce a kwarg ("replace"?) that replaces cells of identical coordinates from right to left?
That would render
Some people might even want to drop all cells with coordinate collisions (probably not us). If that's the case then the kwarg would be ternary.....
The text was updated successfully, but these errors were encountered: