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/1331#issuecomment-289856794,https://api.github.com/repos/pydata/xarray/issues/1331,289856794,MDEyOklzc3VlQ29tbWVudDI4OTg1Njc5NA==,1217238,2017-03-28T18:11:02Z,2017-03-28T18:11:02Z,MEMBER,"> Given your two Datasets and your desired result, why not simply using concat? OK, I feel pretty dumb now. Yes, that's totally the right way to do this. For some reason I was fixated on converting each dataset individually to have a MultiIndex before combining them.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,217347106 https://github.com/pydata/xarray/issues/1331#issuecomment-289559117,https://api.github.com/repos/pydata/xarray/issues/1331,289559117,MDEyOklzc3VlQ29tbWVudDI4OTU1OTExNw==,1217238,2017-03-27T19:27:27Z,2017-03-27T19:27:27Z,MEMBER,"Currently the best I have is: ```python (ds1.reset_index('x') .rename({'x': 'yx', 'x_': 'x'}) .assign_coords(y=lambda ds: (('yx',), [ds.y.item()] * 3)) .set_index(yx=['y', 'x'])) ``` ``` Dimensions: (yx: 3) Coordinates: * yx (yx) MultiIndex - y (yx) object 'a' 'a' 'a' - x (yx) int64 1 2 3 Data variables: foo (yx) int64 1 2 3 ``` which is rather un-intuitive. It occurs to me that maybe this is just a good use case for `expand_dims` (#1326), which could make this as simple as `ds1.expand_dims('y').stack(yx=['y', 'x']))`","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,217347106