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/1471#issuecomment-524895731,https://api.github.com/repos/pydata/xarray/issues/1471,524895731,MDEyOklzc3VlQ29tbWVudDUyNDg5NTczMQ==,4762711,2019-08-26T15:00:35Z,2019-08-26T15:00:35Z,NONE,"I just wanted to chime in as to the usefulness of being able to do something like this without the extra mental overhead being required by the workaround proposed. My use case parallels @smartass101's very closely. Have there been any updates to xarray since last year that might make streamlining this use case a bit more feasible, by any chance? :)","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,241290234
https://github.com/pydata/xarray/issues/1471#issuecomment-433952128,https://api.github.com/repos/pydata/xarray/issues/1471,433952128,MDEyOklzc3VlQ29tbWVudDQzMzk1MjEyOA==,21049064,2018-10-29T15:21:34Z,2018-10-29T15:21:34Z,NONE,"@smartass101 & @shoyer what would be the code for working with a `pandas.MultiIndex` object in this use case? Could you show how it would work related to your example above:
```
Dimensions: (num: 21, ar:2) # <-- note that MB is still of dims {'num': 19} only
Coordinates: # <-- mostly unions as done by concat
* num (num) int64 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
B
wrote:
> I indeed often resort to using a pandas.MultiIndex, but especially the
> dropping of the selected coordinate value (#1408
> ) makes it quite
> inconvenient.
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> , or mute
> the thread
>
> .
>
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,241290234
https://github.com/pydata/xarray/issues/1471#issuecomment-430946620,https://api.github.com/repos/pydata/xarray/issues/1471,430946620,MDEyOklzc3VlQ29tbWVudDQzMDk0NjYyMA==,941907,2018-10-18T09:48:20Z,2018-10-18T09:48:20Z,NONE,"I indeed often resort to using a `pandas.MultiIndex`, but especially the dropping of the selected coordinate value (#1408) makes it quite inconvenient.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,241290234
https://github.com/pydata/xarray/issues/1471#issuecomment-430358013,https://api.github.com/repos/pydata/xarray/issues/1471,430358013,MDEyOklzc3VlQ29tbWVudDQzMDM1ODAxMw==,1217238,2018-10-16T19:00:16Z,2018-10-16T19:00:34Z,MEMBER,"You can use a `pandas.MultiIndex` with xarray. The interface/abstraction could be improved and has some rough edges (e.g., see especially https://github.com/pydata/xarray/issues/1603), but I think this is the preferred way to support these use cases. It does already work for indexing.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,241290234
https://github.com/pydata/xarray/issues/1471#issuecomment-430324391,https://api.github.com/repos/pydata/xarray/issues/1471,430324391,MDEyOklzc3VlQ29tbWVudDQzMDMyNDM5MQ==,941907,2018-10-16T17:24:42Z,2018-10-16T17:46:17Z,NONE,"I've hit this design limitation quite often as well, with several use-cases, both in experiment and simulation. It detracts from xarray's power of **conveniently** and transparently handling coordinate meta-data. From the [Why xarray?](http://xarray.pydata.org/en/stable/why-xarray.html) page:
> with xarray, you don’t need to keep track of the order of arrays dimensions or insert **dummy dimensions**
Adding effectively dummy dimensions or coordinates is essentially what this alignment design is forcing us to do.
A possible solution would be something like having (some) coordinate arrays in an (Unaligned)Dataset being a ""reducible"" (it would reduce to Index for each Datarray) MultiIndex. A workaround can be using MultiIndex coordinates directly, but then alignment cannot be done easily as levels do not behave as real dimensions.
# Use-cases examples:
## 1. coordinate ""metadata""
I often have measurements on related axes, but also with additional coordinates (different positions, etc.) Consider:
```python
import numpy as np
import xarray as xr
n1 = np.arange(1, 22)
m1 = xr.DataArray(n1*0.5, coords={'num': n1, 'B': 'r', 'ar' :'A'}, dims=['num'], name='MA')
n2 = np.arange(2, 21)
m2 = xr.DataArray(n2*0.5, coords={'num': n2, 'B': 'r', 'ar' :'B'}, dims=['num'], name='MB')
ds = xr.merge([m1, m2])
print(ds)
```
What I would like to get (pseudocode):
```python
Dimensions: (num: 21, ar:2) # <-- note that MB is still of dims {'num': 19} only
Coordinates: # <-- mostly unions as done by concat
* num (num) int64 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
B
array('A', dtype='
array('B', dtype='