home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

2 rows where author_association = "CONTRIBUTOR", issue = 484089737 and user = 2818208 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 1

  • gwgundersen · 2 ✖

issue 1

  • assign_coords adds coordinates without a new dimension if the value is scalar · 2 ✖

author_association 1

  • CONTRIBUTOR · 2 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
524617139 https://github.com/pydata/xarray/issues/3240#issuecomment-524617139 https://api.github.com/repos/pydata/xarray/issues/3240 MDEyOklzc3VlQ29tbWVudDUyNDYxNzEzOQ== gwgundersen 2818208 2019-08-25T10:02:39Z 2019-08-25T10:02:39Z CONTRIBUTOR

I see. This is because coordinates are just DataArray objects. So

```python

arr.coords['y'] = range(3) ```

is equivalent to

```python

new_coords = xr.DataArray(data=range(3)) arr.coords['y'] = new_coords ```

And the reason this is a ValueError is that new_coords has a default dimension dim_0 that is not on arr. However, this

```python

arr.coords['y'] = 1 ```

is equivalent to...

```python

new_coords = xr.DataArray(data=1, dims=[]) arr.coords['y'] = new_coords ```

And new_coords has no dimensions that are not on arr.

{
    "total_count": 2,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 1,
    "eyes": 0
}
  assign_coords adds coordinates without a new dimension if the value is scalar 484089737
524525841 https://github.com/pydata/xarray/issues/3240#issuecomment-524525841 https://api.github.com/repos/pydata/xarray/issues/3240 MDEyOklzc3VlQ29tbWVudDUyNDUyNTg0MQ== gwgundersen 2818208 2019-08-24T06:39:00Z 2019-08-24T06:39:00Z CONTRIBUTOR

@shoyer, maybe I am missing a nuance in your answer, but I think I already understand this bit about Xarray. My question was why is it is allowed to add a scalar:

```python

arr = xr.DataArray(range(3), dims=['x'], coords={'x': list('abc')}) arr.coords Coordinates: * x (x) <U1 'a' 'b' 'c' arr.coords['y'] = 1 # <----------- Why does this work? arr.coords Coordinates: * x (x) <U1 'a' 'b' 'c' y int64 1 ```

In this case, y are coordinates that do not share an existing dimension.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  assign_coords adds coordinates without a new dimension if the value is scalar 484089737

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 16.777ms · About: xarray-datasette