home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

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

  • headtr1ck 3
  • dcherian 2

author_association 2

  • COLLABORATOR 3
  • MEMBER 2

issue 1

  • What should `Dataset.count` return for missing dims? · 5 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
1178768111 https://github.com/pydata/xarray/issues/6749#issuecomment-1178768111 https://api.github.com/repos/pydata/xarray/issues/6749 IC_kwDOAMm_X85GQpLv headtr1ck 43316012 2022-07-08T09:30:56Z 2022-07-08T09:30:56Z COLLABORATOR

Another option is to add an option: missing_dim: "raise", ignore" or "broadcast". The default then would be ignore, which is the current implementation.

But for workflows of variables that are either DataArray or Dataset, this argument should be added to DataArray.sum/count/prod as well?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  What should `Dataset.count` return for missing dims? 1292284929
1177944075 https://github.com/pydata/xarray/issues/6749#issuecomment-1177944075 https://api.github.com/repos/pydata/xarray/issues/6749 IC_kwDOAMm_X85GNgAL headtr1ck 43316012 2022-07-07T17:07:10Z 2022-07-07T17:07:10Z COLLABORATOR

I think that changing the behavior of sum is quite a large breaking change.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  What should `Dataset.count` return for missing dims? 1292284929
1176959116 https://github.com/pydata/xarray/issues/6749#issuecomment-1176959116 https://api.github.com/repos/pydata/xarray/issues/6749 IC_kwDOAMm_X85GJviM dcherian 2448579 2022-07-07T02:05:06Z 2022-07-07T02:05:06Z MEMBER

We discussed: 1. dropping variables without the dimension 2. Return ds.sizes["x"] by broadcasting b along x


For the other reductions

``` python import numpy as np import xarray as xr

from xarray.core.duck_array_ops import count

ds = xr.Dataset({"a": ("x", [1, 2, 3]), "b": ("y", [4, 5])})

for func in [np.nansum, np.nanprod, np.nanmean, np.nanvar, np.nanstd, count]: print(f"{func.name!s}({ds.b.data}, axis=()) = {func(ds.b.data, axis=())}") ```

gives nansum([4 5], axis=()) = [4 5] nanprod([4 5], axis=()) = [4 5] nanmean([4 5], axis=()) = [4. 5.] nanvar([4 5], axis=()) = [0. 0.] nanstd([4 5], axis=()) = [0. 0.] count([4 5], axis=()) = [1 1]

I guess the output for nansum, nanprod doesn't match what you would get by broadcasting along the absent dimension.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  What should `Dataset.count` return for missing dims? 1292284929
1176517619 https://github.com/pydata/xarray/issues/6749#issuecomment-1176517619 https://api.github.com/repos/pydata/xarray/issues/6749 IC_kwDOAMm_X85GIDvz headtr1ck 43316012 2022-07-06T17:58:49Z 2022-07-06T17:58:49Z COLLABORATOR

What happens when you call a ufunc with an empty axis tuple?

This should also happen with all other ufuncs then? I guess most of them just work, like mean, sum etc.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  What should `Dataset.count` return for missing dims? 1292284929
1175235698 https://github.com/pydata/xarray/issues/6749#issuecomment-1175235698 https://api.github.com/repos/pydata/xarray/issues/6749 IC_kwDOAMm_X85GDKxy dcherian 2448579 2022-07-05T16:09:55Z 2022-07-05T16:09:55Z MEMBER

This is quite confusing and I doubt it's intentional.

I would've expected b (y) int32 3 3 assuming that it would've been broadcast along the reduction dimension.

The final value is the result of

``` python import numpy as np from xarray.core.duck_array_ops import isnull

np.sum(np.logical_not(isnull(ds.b.data)), axis=())

np.sum([True, True], axis=())

```

What happens when you call a ufunc with an empty axis tuple? I bet this is just casting bool to int.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  What should `Dataset.count` return for missing dims? 1292284929

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