-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
multi-index panel to xrarray dataarray index selection #850
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
Comments
Sorry for the delay. I put #802 aside for some time but now I'm working on it again and hopefully I'll commit tests and docs in a couple of days. #802 fixes the case above, although it currently requires to pass a dictionary with explicit index level names or numbers as keys: x.loc[:, {0: slice(None), 1: 3}, 'A'] #<- It works with #802 |
Merged
After some additional commits in #802:
|
Thanks to #802, this works now in xarray v0.8. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am playing with xarray (moving away from pandas panel) but I cannot get my head around the following example. I create a multiindex panel and then convert it to a dataarray. I would like then to slice as I used to do in pandas , but trying the equivalent it fails with
TypeError: '(slice(None, None, None), [3])' is an invalid key
Similarly I cannot get x.sel(major_axis=?) to work trying to achieve the same result.
Do you have any insight?
The text was updated successfully, but these errors were encountered: