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 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='