home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 1431400086

This data as json

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/7076#issuecomment-1431400086 https://api.github.com/repos/pydata/xarray/issues/7076 1431400086 IC_kwDOAMm_X85VUW6W 18679148 2023-02-15T13:49:45Z 2023-02-16T13:43:29Z NONE

Hi @DWesl, @benbovy

I got a bug very similar to what was initially report with the following minimal example (xarray version 2022.11.0) with the error:

ValueError: cannot unstack dimensions that do not have exactly one multi-index: ('z',)

It is working fine with my previous version (xarray 0.16.0) python import xarray as xr ds = xr.Dataset( data_vars=dict( mydata = ( ['across', 'along'], [[0,1],[2,3]]) ) ) stacked = ds.stack(z=("across", "along")) newlist = [None] * stacked.z.size for ii, zindex in enumerate(stacked.z.data): newlist[ii] = stacked.mydata.sel(z=zindex) newds = xr.concat(newlist, dim='z') newds['z'] = stacked.z print('xarray version:' + xr.__version__) newds.unstack(dim='z')

If I do newds = newds.reset_index('z') just before the last line, it is solved for my minimal example. But it still doesn't work for my real problem and I don't think it is the best way to proceed.

Many thanks for your help, Adrien

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  1384465119
Powered by Datasette · Queries took 0.649ms · About: xarray-datasette