home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

3 rows where author_association = "MEMBER" and issue = 435170643 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 1

  • dcherian 3

issue 1

  • xr.dot result differs from np.dot · 3 ✖

author_association 1

  • MEMBER · 3 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
484970078 https://github.com/pydata/xarray/issues/2907#issuecomment-484970078 https://api.github.com/repos/pydata/xarray/issues/2907 MDEyOklzc3VlQ29tbWVudDQ4NDk3MDA3OA== dcherian 2448579 2019-04-19T17:51:44Z 2019-04-19T17:51:44Z MEMBER

automatic broadcasting is an extremely useful feature of xarray: See https://xarray.pydata.org/en/stable/computation.html#broadcasting-by-dimension-name for examples.

What I didn't know was that the dimensions to multiply have to have the same names.

If the dimensions don't have the same name; xarray "broadcasts" both variables so that they each have both dimensions and then does the arithmetic operation you ask it to.

I thought I could sum over different coordinates indicating the names within the dims keyword, but the implementation makes totally sense now. To summarize:

This is correct but you're misunderstanding the applicability here (I think).

But shouldn't there be an error message if one specifies dimensions to dims that are not in both of the dataarrays?

No, broadcasting is a feature.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  xr.dot result differs from np.dot 435170643
484923935 https://github.com/pydata/xarray/issues/2907#issuecomment-484923935 https://api.github.com/repos/pydata/xarray/issues/2907 MDEyOklzc3VlQ29tbWVudDQ4NDkyMzkzNQ== dcherian 2448579 2019-04-19T15:05:25Z 2019-04-19T15:06:03Z MEMBER

Here's some relevant documentation: https://xarray.pydata.org/en/stable/computation.html#broadcasting-by-dimension-name

EDIT: Please let us know if these can be improved in any way (or even better, send in a pull request to improve it).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  xr.dot result differs from np.dot 435170643
484923134 https://github.com/pydata/xarray/issues/2907#issuecomment-484923134 https://api.github.com/repos/pydata/xarray/issues/2907 MDEyOklzc3VlQ29tbWVudDQ4NDkyMzEzNA== dcherian 2448579 2019-04-19T15:02:59Z 2019-04-19T15:02:59Z MEMBER

You have two different dimensions here; and xarray is broadcasting so those two statements are not equal i.e. both weights and models end up being 2D arrays which are then operated upon by dot.

How about xr.dot(weights_da.rename({'models': 'model name'}), models)?

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  xr.dot result differs from np.dot 435170643

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