home / github

Menu
  • GraphQL API
  • Search all tables

issues

Table actions
  • GraphQL API for issues

1 row where user = 76457120 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date), closed_at (date)

type 1

  • issue 1

state 1

  • closed 1

repo 1

  • xarray 1
id node_id number title user state locked assignee milestone comments created_at updated_at ▲ closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
1361989642 I_kwDOAMm_X85RLlAK 6990 New MultiIndex dimension behaviours ConnorSwales 76457120 closed 0     2 2022-09-05T13:37:29Z 2023-03-12T10:17:14Z 2023-03-12T10:17:13Z NONE      

What is your issue?

As of the latest release (2022.6.0), the behaviour of MultiIndex coordinates and their constituents appears to have changed.

Creating a simple multi-indexed DataSet:

``` ds1 = xr.Dataset({'foo': (('x',), [1, 2, 3])}, {'x': [1, 2, 3], 'y': 'a'}) ds2 = xr.Dataset({'foo': (('x',), [4, 5, 6])}, {'x': [1, 2, 3], 'y': 'b'})

mult = xr.concat([ds1, ds2], dim='y').stack(yx=['y', 'x']) ```

Printing the DataSet and the coordinate indices on version 2022.3.0: mult <xarray.Dataset> Dimensions: (yx: 6) Coordinates: * yx (yx) MultiIndex - y (yx) object 'a' 'a' 'a' 'b' 'b' 'b' - x (yx) int64 1 2 3 1 2 3 Data variables: foo (yx) int64 1 2 3 4 5 6

mult.coords.indexes yx: MultiIndex([('a', 1), ('a', 2), ('a', 3), ('b', 1), ('b', 2), ('b', 3)], names=['y', 'x'])

Printing the DataSet and the coordinate indices on version 2022.6.0: mult <xarray.Dataset> Dimensions: (yx: 6) Coordinates: * yx (yx) object MultiIndex * y (yx) <U1 'a' 'a' 'a' 'b' 'b' 'b' * x (yx) int64 1 2 3 1 2 3 Data variables: foo (yx) int64 1 2 3 4 5 6

mult.coords.indexes Indexes: yx: MultiIndex([('a', 1), ('a', 2), ('a', 3), ('b', 1), ('b', 2), ('b', 3)], name='yx') y: MultiIndex([('a', 1), ('a', 2), ('a', 3), ('b', 1), ('b', 2), ('b', 3)], name='yx') x: MultiIndex([('a', 1), ('a', 2), ('a', 3), ('b', 1), ('b', 2), ('b', 3)], name='yx')

On the latest version (2022.6.0), the constituent coordinates (x,y) of the multi-indexed coordinate (yx) have asterisks next to them, implying that they are dimensional (despite the them not being named equal to their sole dimension, as stated in the docs' coordinates section).

dimension coordinates are one dimensional coordinates with a name equal to their sole dimension (marked by * when printing a dataset or data array)

Further, looking into the .coords.indexes shows that each constituent coordinate is also indexed by an instance of the same MultiIndex.

I was wondering if this change been made design and whether the documentation just need updating, or I have misunderstood something along the way.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/6990/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed xarray 13221727 issue

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issues] (
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [number] INTEGER,
   [title] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [state] TEXT,
   [locked] INTEGER,
   [assignee] INTEGER REFERENCES [users]([id]),
   [milestone] INTEGER REFERENCES [milestones]([id]),
   [comments] INTEGER,
   [created_at] TEXT,
   [updated_at] TEXT,
   [closed_at] TEXT,
   [author_association] TEXT,
   [active_lock_reason] TEXT,
   [draft] INTEGER,
   [pull_request] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [state_reason] TEXT,
   [repo] INTEGER REFERENCES [repos]([id]),
   [type] TEXT
);
CREATE INDEX [idx_issues_repo]
    ON [issues] ([repo]);
CREATE INDEX [idx_issues_milestone]
    ON [issues] ([milestone]);
CREATE INDEX [idx_issues_assignee]
    ON [issues] ([assignee]);
CREATE INDEX [idx_issues_user]
    ON [issues] ([user]);
Powered by Datasette · Queries took 478.973ms · About: xarray-datasette