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/1030#issuecomment-457808785,https://api.github.com/repos/pydata/xarray/issues/1030,457808785,MDEyOklzc3VlQ29tbWVudDQ1NzgwODc4NQ==,26384082,2019-01-26T07:06:43Z,2019-01-26T07:06:43Z,NONE,"In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity If this issue remains relevant, please comment here; otherwise it will be marked as closed automatically ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,180676935 https://github.com/pydata/xarray/issues/1030#issuecomment-251355756,https://api.github.com/repos/pydata/xarray/issues/1030,251355756,MDEyOklzc3VlQ29tbWVudDI1MTM1NTc1Ng==,4160723,2016-10-04T10:48:17Z,2016-10-04T10:49:56Z,MEMBER,"Thanks for the tip @shoyer ! Using something like `combined.set_index(spectrum=['band', 'wn'])` or `xr.concat(arrays, dim={'spectrum': ['band', 'wn']})` would be nice, although it may be a bit weird to use the key `spectrum` to rename the `wn` dimension here. For now, I'm fine with setting the MultIndex using the more explicit - though more verbose - `combined.set_index(wn=['band', 'wn']).rename({'wn': 'spectrum'})` ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,180676935 https://github.com/pydata/xarray/issues/1030#issuecomment-251154675,https://api.github.com/repos/pydata/xarray/issues/1030,251154675,MDEyOklzc3VlQ29tbWVudDI1MTE1NDY3NQ==,1217238,2016-10-03T16:29:27Z,2016-10-03T16:29:27Z,MEMBER,"One option that gets you part way there: ``` python arrays = [ds['data_band%d' % i].rename({'wn_band%d' % i: 'wn'}).assign_coords(band=i) for i in range(1, 4)] combined = xr.concat(arrays, dim='wn') ``` This would still need some work (e.g., with `set_index` #1028) to set the MultiIndex. Ideally, maybe you could write something like `combined.set_index(spectrum=['band', 'wn'])` to create the new dimension and MultiIndex all at once. It does seem like something like the `key` argument to `pandas.concat` would make sense here: http://pandas.pydata.org/pandas-docs/stable/merging.html#more-concatenating-with-group-keys The API is not so obvious for us, though, because we need to supply the new dimension name and levels all at once. Maybe something like `xr.concat(arrays, dim={'spectrum': ['band', 'wn']}` would work. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,180676935