home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 162020564

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/pull/668#issuecomment-162020564 https://api.github.com/repos/pydata/xarray/issues/668 162020564 MDEyOklzc3VlQ29tbWVudDE2MjAyMDU2NA== 2443309 2015-12-04T16:55:25Z 2015-12-04T16:55:25Z MEMBER

For iteration, what about only iterating over full windows? Thinking about how I might use iteration, I think this might be more useful than returning some shrunk windows.

I did consider this at first and it wouldn't be all that hard to implement but I chose not to go this route because I wanted consistency between reduce, _bottleneck_reduce and __iter__. In theory, all three of these should provide the same answer:

``` Python rolling_obj = da.rolling(time=4)

rolling_obj.mean() # bottleneck move_mean rolling_obj.reduce(np.nanmean) # numpy nanmean over each window concat([da.mean(dim='time') for _, da in rolling_obj], dim=rolling_obj.window_labels) # manual mean via iterable - same as reduce ```

I think you've done a pretty reasonable job of interpreting min_periods for iteration, but I would still vote for defining it only as an argument to the aggregation methods and not worrying about it for iteration.

How did pandas land on this. To me it makes more sense as an argument to __init__ but I'll go with whatever pandas decided for consistency.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  120038291
Powered by Datasette · Queries took 0.635ms · About: xarray-datasette