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/pull/1412#issuecomment-302878939,https://api.github.com/repos/pydata/xarray/issues/1412,302878939,MDEyOklzc3VlQ29tbWVudDMwMjg3ODkzOQ==,1217238,2017-05-20T15:11:24Z,2017-05-20T15:11:24Z,MEMBER,"@fujiisoup Yes, the solution of writing a MultiIndex wrapper for xarray looks much cleaner to me. I like the look of this proposal! (Those diagrams are also very helpful) I guess this could be implemented as a `pandas.MultiIndex` along with a list of scalar coordinates?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,229370997 https://github.com/pydata/xarray/pull/1412#issuecomment-302425186,https://api.github.com/repos/pydata/xarray/issues/1412,302425186,MDEyOklzc3VlQ29tbWVudDMwMjQyNTE4Ng==,1217238,2017-05-18T14:42:57Z,2017-05-18T14:42:57Z,MEMBER,"> To me it looks like it is a bit too magical, but just wondering what you think... Agreed, this also seems too magical to me.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,229370997 https://github.com/pydata/xarray/pull/1412#issuecomment-302170558,https://api.github.com/repos/pydata/xarray/issues/1412,302170558,MDEyOklzc3VlQ29tbWVudDMwMjE3MDU1OA==,1217238,2017-05-17T17:42:58Z,2017-05-17T17:42:58Z,MEMBER,"> variable.__getitem__ now returns an OrderedDict if a single element is selected from MultiIndex. I don't like this change. It breaks an important invariant, which is that indexing a Variable returns another Variable. I do agree with indexing along a MultiIndex dimension should unpacking the tuple for coordinates, but only for coordinates. So this needs to be somewhere in the `Dataset.isel` logic, not `Variable.isel`. Consider indexing `ds['yx']` from your example in the linked issue. With the current version of xarray: ``` In [7]: ds['yx'] Out[7]: array([('a', 1), ('a', 2), ('a', 3), ('b', 1), ('b', 2), ('b', 3)], dtype=object) Coordinates: * yx (yx) MultiIndex - y (yx) object 'a' 'a' 'a' 'b' 'b' 'b' - x (yx) int64 1 2 3 1 2 3 In [8]: ds['yx'][0] Out[8]: array(('a', 1), dtype=object) Coordinates: yx object ('a', 1) ``` We want to change the indexing behavior to this: ``` In [8]: ds['yx'][0] Out[8]: array(('a', 1), dtype=object) Coordinates: y object 'a' x int64 1 ``` But we don't want to change what happens to the DataArray itself -- it should still be a scalar object array. I tested this example on your PR branch, and it actually crashes with `KeyError`.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,229370997