home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

2 rows where issue = 1379365175 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

  • benbovy 2

issue 1

  • Multiply along a specific dimension · 2 ✖

author_association 1

  • MEMBER 2
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
1254870161 https://github.com/pydata/xarray/issues/7058#issuecomment-1254870161 https://api.github.com/repos/pydata/xarray/issues/7058 IC_kwDOAMm_X85Ky8yR benbovy 4160723 2022-09-22T11:05:40Z 2022-09-22T11:05:40Z MEMBER

@adelezaini I'm moving this issue to discussion Q&A as to my understanding Xarray already supports the operation that you describe here. Please let me know if I misunderstood your problem.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Multiply along a specific dimension 1379365175
1252540520 https://github.com/pydata/xarray/issues/7058#issuecomment-1252540520 https://api.github.com/repos/pydata/xarray/issues/7058 IC_kwDOAMm_X85KqEBo benbovy 4160723 2022-09-20T15:38:02Z 2022-09-20T15:40:34Z MEMBER

Hi @adelezaini,

I'm a bit confused since you're trying to make a simple operation between two DataArrays and the example that you mention is about element-wise product of a DataArray with an unlabelled numpy array.

If you want to perform an element-wise operation like * between two DataArrays, xarray supports automatic broadcasting by dimension name, so all you need is to ensure that the two DataArrays share common dimension names and have the same number of elements along those dimensions (the latter is not strictly required if the DataArrays both have coordinates along those dimensions, in which case xarray also automatically aligns the two DataArrays).

I believe a very useful implementation would be adding xr.mult(arrays, dim, args) - or xr.prod or similar -,

There's already DataArray.prod but it serves a different purpose, i.e., compute the product of array elements over a given dimension and return a reduced DataArray (like numpy.prod).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Multiply along a specific dimension 1379365175

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