home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

1 row where issue = 805389572 and user = 5637662 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

  • dschwoerer · 1 ✖

issue 1

  • Dataset.mean changes variables without specified dimension · 1 ✖

author_association 1

  • CONTRIBUTOR 1
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
788052130 https://github.com/pydata/xarray/issues/4885#issuecomment-788052130 https://api.github.com/repos/pydata/xarray/issues/4885 MDEyOklzc3VlQ29tbWVudDc4ODA1MjEzMA== dschwoerer 5637662 2021-03-01T15:47:52Z 2021-03-01T15:47:52Z CONTRIBUTOR

I tried this: diff --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -4701,7 +4701,9 @@ class Dataset(Mapping, ImplementsDatasetReduce, DataWithCoords): if not reduce_dims: variables[name] = var else: - if ( + if not reduce_dims: + variables[name] = var + elif ( not numeric_only or np.issubdtype(var.dtype, np.number) or (var.dtype == np.bool_) which works great for mean - "var" stays an integer, as expected.

However, that breaks ds.std - which should be zero for "var", but isn't. I guess that is ok for coords - as the assumption is that on coordinates the calculation is not done, but for data variables this is probably not ok.

```diff --- a/xarray/core/duck_array_ops.py +++ b/xarray/core/duck_array_ops.py @@ -537,6 +537,11 @@ def mean(array, axis=None, skipna=None, **kwargs): dtypes""" from .common import _contains_cftime_datetimes

  • The mean over an empty axis shouldn't change the data

  • See https://github.com/pydata/xarray/issues/4885

  • if not axis:
  • return array + array = asarray(array) if array.dtype.kind in "Mm": offset = _datetime_nanmin(array) ``` I think it is best to change mean - which would work also for dataArrays. This implies that mean does not convert to float64 - as the numpy version does, but I guess that should be fine.

Should I open a PR?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Dataset.mean changes variables without specified dimension 805389572

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