home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

7 rows where author_association = "MEMBER" and issue = 308030789 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 4

  • fujiisoup 4
  • shoyer 1
  • max-sixty 1
  • mathause 1

issue 1

  • rolling.mean vs rolling.construct.mean · 7 ✖

author_association 1

  • MEMBER · 7 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
376342444 https://github.com/pydata/xarray/issues/2010#issuecomment-376342444 https://api.github.com/repos/pydata/xarray/issues/2010 MDEyOklzc3VlQ29tbWVudDM3NjM0MjQ0NA== fujiisoup 6815844 2018-03-26T23:16:57Z 2018-03-26T23:16:57Z MEMBER

I think that masking the construct-ed array would make the full copy of this, while originally construct returns a view of the original array. Another option would be to support an additional method (get_mask?), but as this can be realized quite easily (rolling.count() > rolling.min_periods) I am not sure how worth it is.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  rolling.mean vs rolling.construct.mean 308030789
376274290 https://github.com/pydata/xarray/issues/2010#issuecomment-376274290 https://api.github.com/repos/pydata/xarray/issues/2010 MDEyOklzc3VlQ29tbWVudDM3NjI3NDI5MA== shoyer 1217238 2018-03-26T18:56:29Z 2018-03-26T18:56:29Z MEMBER

Would it make sense to support min_periods in construct by masking the result? That would arguably be consistent with how we do iteration over rolling objects, though to be honest I'm not sure how useful it really is.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  rolling.mean vs rolling.construct.mean 308030789
375750884 https://github.com/pydata/xarray/issues/2010#issuecomment-375750884 https://api.github.com/repos/pydata/xarray/issues/2010 MDEyOklzc3VlQ29tbWVudDM3NTc1MDg4NA== max-sixty 5635139 2018-03-23T17:57:11Z 2018-03-23T17:57:11Z MEMBER

I think we need to document more clearly that min_periods option is just neglected if using construct method.

I also think we could label construct as advanced / experimental. It's extremely cool, but for traditional cases, it's probably more cool than required, and less well tested than the standard methods.

At the moment we say "You can use this for more advanced rolling operations, such as strided rolling, windowed rolling, convolution, short-time FFT, etc."; I'm imagining adding something like "For standard operations above, there is no need to use construct". Or adding an Experimental marker

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  rolling.mean vs rolling.construct.mean 308030789
375684859 https://github.com/pydata/xarray/issues/2010#issuecomment-375684859 https://api.github.com/repos/pydata/xarray/issues/2010 MDEyOklzc3VlQ29tbWVudDM3NTY4NDg1OQ== fujiisoup 6815844 2018-03-23T14:34:53Z 2018-03-23T14:34:53Z MEMBER

Ok, so ds.rolling.mean allows for min_periods while ds.rolling.construct.mean allows for fill_value?

Yes. Originally, construct method is designed for more advanced use cases, such as strided moving average, weighted mean, short time FFT, etc.

On the other hand, using skipna=False resores the default behaviour or ds.rolling

It is not strictly true. min_periods also considers nan values that already exist in the original array. This behavior is the same with pandas rolling.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  rolling.mean vs rolling.construct.mean 308030789
375682093 https://github.com/pydata/xarray/issues/2010#issuecomment-375682093 https://api.github.com/repos/pydata/xarray/issues/2010 MDEyOklzc3VlQ29tbWVudDM3NTY4MjA5Mw== mathause 10194086 2018-03-23T14:26:17Z 2018-03-23T14:26:17Z MEMBER

Ok, so ds.rolling.mean allows for min_periods while ds.rolling.construct.mean allows for fill_value?

On the other hand, using skipna=False resores the default behaviour or ds.rolling ``` ds.rolling(dim=3, center=True).construct('window').mean('window', skipna=False)

RESULT: array([nan, 1., 2., nan])

```


Actually I'm sure that min_periods and fill_value are not the only differences between the two - but that's how far my understanding got at the moment.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  rolling.mean vs rolling.construct.mean 308030789
375678008 https://github.com/pydata/xarray/issues/2010#issuecomment-375678008 https://api.github.com/repos/pydata/xarray/issues/2010 MDEyOklzc3VlQ29tbWVudDM3NTY3ODAwOA== fujiisoup 6815844 2018-03-23T14:13:04Z 2018-03-23T14:13:04Z MEMBER

I think we need to document more clearly that min_periods option is just neglected if using construct method.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  rolling.mean vs rolling.construct.mean 308030789
375676323 https://github.com/pydata/xarray/issues/2010#issuecomment-375676323 https://api.github.com/repos/pydata/xarray/issues/2010 MDEyOklzc3VlQ29tbWVudDM3NTY3NjMyMw== fujiisoup 6815844 2018-03-23T14:07:42Z 2018-03-23T14:07:42Z MEMBER

Hi, @mathause. Thanks for reporting.

I agree that this behavior is a little surprising, but this is something expected. The difference is not skipna=True (both use this), but actually in min_periods. If you specify min_periods=1, then the results become identical. python In [7]: ds.rolling(dim=3, center=True, min_periods=1).mean() Out[7]: <xarray.DataArray (dim: 4)> array([0.5, 1. , 2. , 2.5]) Dimensions without coordinates: dim

I am not sure how we can make both the behaviors the same with keeping the generality of construct method.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  rolling.mean vs rolling.construct.mean 308030789

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