home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

2 rows where author_association = "NONE", issue = 419543087 and user = 32069530 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

  • lanougue · 2 ✖

issue 1

  • [Feature Request] iteration equivalent numpy's nditer or ndenumerate · 2 ✖

author_association 1

  • NONE · 2 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
1255029201 https://github.com/pydata/xarray/issues/2805#issuecomment-1255029201 https://api.github.com/repos/pydata/xarray/issues/2805 IC_kwDOAMm_X85KzjnR lanougue 32069530 2022-09-22T13:30:26Z 2022-09-22T16:12:47Z NONE

Hello guys,

While waiting for a integrated solution. Here is a function that should do the job in a safe way. It returns an iterator

```` def xndindex(ds, dims=None): if dims is None: dims = ds.dims elif type(dims) is str: dims=[dims] else: pass

for d in dims:
    if d not in ds.dims:
        raise ValueError("Invalid dimension '{}'. Available dimensions {}".format(d, ds.dims))

iter_dict = {k:v for k,v in ds.sizes.items() if k in dims}
for d,k in zip(repeat(tuple(iter_dict.keys())),zip(np.ndindex(tuple(iter_dict.values())))):
    yield {k:l for k,l in zip(d,k[0])}

Example of use a = xr.DataArray(np.random.rand(4,3), dims=['x','y'], coords={'x':np.arange(4), 'y':np.arange(3)}) for i in xndindex(a): print(a[i]) ````

{
    "total_count": 2,
    "+1": 2,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  [Feature Request] iteration equivalent numpy's nditer or ndenumerate 419543087
1239645797 https://github.com/pydata/xarray/issues/2805#issuecomment-1239645797 https://api.github.com/repos/pydata/xarray/issues/2805 IC_kwDOAMm_X85J435l lanougue 32069530 2022-09-07T16:53:34Z 2022-09-07T17:00:44Z NONE

Hi guys,

For now, when I want to iterate over all my dataset I use the simple (but dangerous I believe) workaround: for i in np.ndindex(ds.shape): res = ds[{d:j for d,j in zip(ds.dims,i)}] but, I am not sure that ndindex will iterate in the good order relatively to the ds.dims return.

Is there any news on this topic ?

Many thanks !

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  [Feature Request] iteration equivalent numpy's nditer or ndenumerate 419543087

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