Skip to content

Meta-indexes with >2 dimensions #10257

Answered by benbovy
wpbonelli asked this question in Q&A
Discussion options

You must be logged in to vote

Note the absence of the star before the j coordinate in the result, indicating that i and j are not associated with an index? But it looks like the index is there

The index is still in the input object but normally it is not in the result ds.a.sel(i=0)._indexes.

By default the index is dropped after the selection unless MetaIndex.isel(...) is implemented such that it returns a new index instance.

if I pass not 2 but 3 indexes to MetaIndex, it breaks down

It breaks down in your example because the selection is done on the DataArrays ds.a and ds.b and not on the Dataset ds. Each of those DataArrays have only a subset of the dimensions linked to the meta-index, which is by default droppe…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by wpbonelli
Comment options

You must be logged in to vote
1 reply
@benbovy
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants