html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue
https://github.com/pydata/xarray/issues/6866#issuecomment-1202813916,https://api.github.com/repos/pydata/xarray/issues/6866,1202813916,IC_kwDOAMm_X85HsXvc,4160723,2022-08-02T15:23:34Z,2022-08-02T15:23:34Z,MEMBER,"Yes, performing selection using coordinate labels (i.e., `.sel()`) is only possible for coordinates that have an index. It has always been the case and it will always be.
Before v2022.6.0, only 1-dimensional coordinates with the name matching the dimension name could have a pandas index or multi-index. Hence the distinction between a ""dimension coordinate"" which most often implicitly wrapped a pandas index and a ""non-dimension"" coordinate for which label-based selection was impossible.
Starting from v2022.6.0, this constraint is relaxed. Although it is not yet fully operational, any coordinate or any group of coordinates (with arbitrary dimensions) may now have an index (either pandas-based or any xarray compatible custom index) and may therefore be used for label-based selection (if the index supports it).","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1325665237
https://github.com/pydata/xarray/issues/6866#issuecomment-1202597691,https://api.github.com/repos/pydata/xarray/issues/6866,1202597691,IC_kwDOAMm_X85Hri87,4160723,2022-08-02T13:43:52Z,2022-08-02T13:43:52Z,MEMBER,"Hi @v-liuwei, thanks for the report.
The issues that your are pointing are part of #6293. There has been many internal changes (+ some subtle public-facing changes) regarding indexes in the last release, but there is still some work for reflecting it in the documentation.
> First, I'm confused that both dimension coordinate/non-dimension coordinate and index coordinate/non-index coordinate appear in the documentation(search to see), but they seem to be the same thing.
I agree, this has always been a source of confusion IMO. Xarray's data model has been updated in the last release such that these two concepts are now different and independent (i.e., it allows a non-dimension coordinate to have an index).
> It seems that arr.indexes only returns indexes of dimensions that have coordinates. However, it's possible to get the index of dimension y through get_index()
`get_index()` creates a pandas index on the fly if it doesn't exists (and if that's possible). I'm wondering whether or not we should eventually depreciate it? I might be missing important use cases, though.
> As you can see, even in the given example code offered by the offical, all the ""virtual"" coordinates are marked as * instead of -, which is a little bit confusing when handling multi-index coordinates in my experience.
This is because multi-index levels now have each their own, real coordinate (the documentation is not yet up-to-date). However, I agree that using the same symbol for multi-coordinate indexes may not be ideal as it is hard to distinguish which coordinate is associated with which index. On the other hand, using two different symbols wouldn't be an elegant solution either if we later depreciate the multi-index dimension coordinate (i.e., `spec` in your example). Maybe this issue could be addressed in the indexes repr section to be added (#6795).
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1325665237