home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

2 rows where issue = 1301023040 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date)

user 2

  • dcherian 1
  • keewis 1

issue 1

  • DataArrayRolling.mean() ignores `skipna=True` kwarg · 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
1438776293 https://github.com/pydata/xarray/issues/6772#issuecomment-1438776293 https://api.github.com/repos/pydata/xarray/issues/6772 IC_kwDOAMm_X85Vwfvl dcherian 2448579 2023-02-21T16:33:14Z 2023-02-21T16:53:35Z MEMBER

I think the reason it's like this is the conflict min_periods vs skipna issue.

We could just raise and ask the user to provide an appropriate min_periods (min_periods=window for skipna=False and min_periods=1 for skipna=True)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  DataArrayRolling.mean() ignores `skipna=True` kwarg 1301023040
1438733254 https://github.com/pydata/xarray/issues/6772#issuecomment-1438733254 https://api.github.com/repos/pydata/xarray/issues/6772 IC_kwDOAMm_X85VwVPG keewis 14808389 2023-02-21T16:04:37Z 2023-02-21T16:04:37Z MEMBER

Apologies for letting this sit for so long.

The reason for the unexpected behavior seems to be that mean is implemented using sum / count: https://github.com/pydata/xarray/blob/21d86450b3cec595c74aa410cbcc367c9c7f8a0a/xarray/core/rolling.py#L176 https://github.com/pydata/xarray/blob/21d86450b3cec595c74aa410cbcc367c9c7f8a0a/xarray/core/rolling.py#L161-L163 where min_periods is applied in the sum (by masking values where count < min_periods).

However, sum on rolling objects will fill any missing values with 0 before doing anything else, so when the actual sum is computed skipna does not have any effect.

So if you were to set min_periods=1 you'd get the same result as what you'd expect while min_periods=3 is what you're seeing.

@pydata/xarray, any idea what to do here? Should we document that passing skipna does not have any effect on rolling window sums / means, or would it be better to change the implementation? Or maybe I'm missing something else?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  DataArrayRolling.mean() ignores `skipna=True` kwarg 1301023040

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