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/6439#issuecomment-1115251379,https://api.github.com/repos/pydata/xarray/issues/6439,1115251379,IC_kwDOAMm_X85CeWKz,22566757,2022-05-02T19:00:47Z,2022-05-02T19:05:19Z,CONTRIBUTOR,"Oh, right, you suggested that [a bit ago](https://github.com/pydata/xarray/issues/6439#issuecomment-1089182651). When I checkout `upstream/main` in my local XArray repository root and run the example, it completes without error. When I fix the example to use the correct dimension, the implicit print on the last line shows the nearly the same as `unstacked_diag` from a few lines earlier. Still not sure what fixed this, but since it's working, I don't care so much. I will wait for this to show up in a release. Thank you!","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1192449540 https://github.com/pydata/xarray/issues/6439#issuecomment-1115232921,https://api.github.com/repos/pydata/xarray/issues/6439,1115232921,IC_kwDOAMm_X85CeRqZ,4160723,2022-05-02T18:39:09Z,2022-05-02T18:39:09Z,MEMBER,"@DWesl have you tried running your code with Xarray's main branch? If yes, could you confirm whether or not it yields the expected output? Thanks!","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1192449540 https://github.com/pydata/xarray/issues/6439#issuecomment-1115127711,https://api.github.com/repos/pydata/xarray/issues/6439,1115127711,IC_kwDOAMm_X85Cd3-f,22566757,2022-05-02T17:04:13Z,2022-05-02T17:45:56Z,CONTRIBUTOR,"> Just a tip: You don't need any stacking for that. Just use an indexer with a new dim: > I am aware that I can extract the diagonal of the arrays by using the same index for each argument of `isel`. That is, in fact, how I extracted the diagonals in each case above (look for `diag_index` to find the examples). <!-- There is a bit that looks very like your example right at the end of the Minimal Complete Verifiable Example, right before the Relevant Log Output section, except my example goes on to actually do the thing the issue is about, and unstack the newly-extracted diagonal of the covariance matrix. --> The bit that interests me is unstacking the relevant dimension, because the data in the original case comes to me with, effectively, a stacked dimension, and I would like to turn it back into an unstacked dimension because that is what I am used to using `pcolormesh` to plot. <!-- This is implied by the issue being about unstacking the diagonals of a series of covariance matrices, rather than about extracting the diagonals of covariance matrices --> That is to say, skipping the unstacking rather defeats the purpose of what I am trying to do<!-- (which is described in XArray terms as unstacking the MultiIndex dimension coordinate)-->, unless you have suggestions for how to create a two-dimensional plot (one using something like `contourf` or `pcolormesh`) of a one-dimensional `Dataset`, or a series of two-dimensional plots from a two-dimensional `Dataset`. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1192449540 https://github.com/pydata/xarray/issues/6439#issuecomment-1115118516,https://api.github.com/repos/pydata/xarray/issues/6439,1115118516,IC_kwDOAMm_X85Cd1u0,43316012,2022-05-02T16:54:25Z,2022-05-02T16:54:25Z,COLLABORATOR,"Just a tip: You don't need any stacking for that. Just use an indexer with a new dim: ```python diag = xr.DataArray(np.arange(12), dims=""diag"") test.isel(dim0=diag, adj_dim0=diag) ``` this should do the trick ;)","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1192449540 https://github.com/pydata/xarray/issues/6439#issuecomment-1089182651,https://api.github.com/repos/pydata/xarray/issues/6439,1089182651,IC_kwDOAMm_X85A65u7,4160723,2022-04-05T18:48:45Z,2022-04-05T18:48:45Z,MEMBER,"I tested your example with Xarray's main branch and it seems to work (at least there's no `ValueError` anymore). Maybe some side effect of the indexes refactor in #5692? I just run the example without inspecting the outputs so not sure if everything is right, though.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1192449540