home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

8 rows where issue = 376953925 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 3

  • mschrimpf 4
  • max-sixty 3
  • stale[bot] 1

author_association 2

  • NONE 5
  • MEMBER 3

issue 1

  • single coordinate is overwritten with dimension by set_index · 8 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
720612094 https://github.com/pydata/xarray/issues/2537#issuecomment-720612094 https://api.github.com/repos/pydata/xarray/issues/2537 MDEyOklzc3VlQ29tbWVudDcyMDYxMjA5NA== mschrimpf 5308236 2020-11-02T17:24:32Z 2020-11-02T17:24:32Z NONE

still relevant

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  single coordinate is overwritten with dimension by set_index 376953925
720044601 https://github.com/pydata/xarray/issues/2537#issuecomment-720044601 https://api.github.com/repos/pydata/xarray/issues/2537 MDEyOklzc3VlQ29tbWVudDcyMDA0NDYwMQ== stale[bot] 26384082 2020-11-01T06:59:07Z 2020-11-01T06:59:07Z NONE

In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity

If this issue remains relevant, please comment here or remove the stale label; otherwise it will be marked as closed automatically

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  single coordinate is overwritten with dimension by set_index 376953925
435676969 https://github.com/pydata/xarray/issues/2537#issuecomment-435676969 https://api.github.com/repos/pydata/xarray/issues/2537 MDEyOklzc3VlQ29tbWVudDQzNTY3Njk2OQ== mschrimpf 5308236 2018-11-04T15:04:03Z 2018-12-01T20:06:11Z NONE

I think the issue stems from this line of code. Removing it leads to the desired MultiIndex. But I'm not sure if it leads to downstream issues, e.g selecting over coord1 then seems to also squeeze that dimension. Perhaps @benbovy and @jhamman can chime in as the owners of that line.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  single coordinate is overwritten with dimension by set_index 376953925
435602025 https://github.com/pydata/xarray/issues/2537#issuecomment-435602025 https://api.github.com/repos/pydata/xarray/issues/2537 MDEyOklzc3VlQ29tbWVudDQzNTYwMjAyNQ== max-sixty 5635139 2018-11-03T16:38:23Z 2018-11-03T16:38:23Z MEMBER

Thanks!

I agree. For a comparable case when a list of length 2 is passed:

```python

d = xr.DataArray([0], coords={'coord1': ('dim', [0]), 'coord2': ('dim', [1])}, dims=['dim'])

In [22]: d Out[22]: <xarray.DataArray (dim: 1)> array([0]) Coordinates: coord2 (dim) int64 1 coord1 (dim) int64 0 Dimensions without coordinates: dim

In [23]: d.set_index(append=True, dim=['coord1','coord2']) Out[23]: <xarray.DataArray (dim: 1)> array([0]) Coordinates: * dim (dim) MultiIndex - coord1 (dim) int64 0 - coord2 (dim) int64 1 ```

I think the rule should be that if a list is passed, it's a multi-index, as per the doc-string.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  single coordinate is overwritten with dimension by set_index 376953925
435560123 https://github.com/pydata/xarray/issues/2537#issuecomment-435560123 https://api.github.com/repos/pydata/xarray/issues/2537 MDEyOklzc3VlQ29tbWVudDQzNTU2MDEyMw== mschrimpf 5308236 2018-11-03T04:37:52Z 2018-11-03T04:37:52Z NONE

I would expect the dimension to become a MultiIndex with a single coordinate:

<xarray.DataArray (dim: 1)> array([0]) Coordinates: * dim MultiIndex coord (dim) int64 0

When there is more than one coordinate that is what happens, but not when there is only a single coordinate.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  single coordinate is overwritten with dimension by set_index 376953925
435553730 https://github.com/pydata/xarray/issues/2537#issuecomment-435553730 https://api.github.com/repos/pydata/xarray/issues/2537 MDEyOklzc3VlQ29tbWVudDQzNTU1MzczMA== max-sixty 5635139 2018-11-03T02:30:06Z 2018-11-03T02:31:51Z MEMBER

Thanks @mschrimpf

Could you clarify the intended output?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  single coordinate is overwritten with dimension by set_index 376953925
435548784 https://github.com/pydata/xarray/issues/2537#issuecomment-435548784 https://api.github.com/repos/pydata/xarray/issues/2537 MDEyOklzc3VlQ29tbWVudDQzNTU0ODc4NA== mschrimpf 5308236 2018-11-03T01:04:50Z 2018-11-03T01:12:53Z NONE

Sorry I missed a line in the issue, added it now. You're right about the .sel -- since it does not operate on dimension levels by default, I manually set the index: d.set_index(append=True, inplace=True, dim=['coord']). However, this now gets rid of the coordinate: <xarray.DataArray (dim: 1)> array([0]) Coordinates: * dim (dim) int64 0 and thus d.sel(coord=0) does not work because the coord has been discarded.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  single coordinate is overwritten with dimension by set_index 376953925
435526670 https://github.com/pydata/xarray/issues/2537#issuecomment-435526670 https://api.github.com/repos/pydata/xarray/issues/2537 MDEyOklzc3VlQ29tbWVudDQzNTUyNjY3MA== max-sixty 5635139 2018-11-02T22:24:02Z 2018-11-02T22:24:02Z MEMBER

Thanks for the issue @mschrimpf

The coord is there:

```python In [2]: d Out[2]: <xarray.DataArray (dim: 1)> array([0]) Coordinates: coord (dim) int64 0 Dimensions without coordinates: dim

```

...but .sel doesn't accept coordinate names, only on dimensions.

Is your issue that sel should accept coordinate names?

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  single coordinate is overwritten with dimension by set_index 376953925

Advanced export

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

CSV options:

CREATE TABLE [issue_comments] (
   [html_url] TEXT,
   [issue_url] TEXT,
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [created_at] TEXT,
   [updated_at] TEXT,
   [author_association] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [issue] INTEGER REFERENCES [issues]([id])
);
CREATE INDEX [idx_issue_comments_issue]
    ON [issue_comments] ([issue]);
CREATE INDEX [idx_issue_comments_user]
    ON [issue_comments] ([user]);
Powered by Datasette · Queries took 13.866ms · About: xarray-datasette