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/issues/2010#issuecomment-376342444,https://api.github.com/repos/pydata/xarray/issues/2010,376342444,MDEyOklzc3VlQ29tbWVudDM3NjM0MjQ0NA==,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}",,308030789 https://github.com/pydata/xarray/issues/2010#issuecomment-376274290,https://api.github.com/repos/pydata/xarray/issues/2010,376274290,MDEyOklzc3VlQ29tbWVudDM3NjI3NDI5MA==,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}",,308030789 https://github.com/pydata/xarray/issues/2010#issuecomment-375750884,https://api.github.com/repos/pydata/xarray/issues/2010,375750884,MDEyOklzc3VlQ29tbWVudDM3NTc1MDg4NA==,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}",,308030789 https://github.com/pydata/xarray/issues/2010#issuecomment-375684859,https://api.github.com/repos/pydata/xarray/issues/2010,375684859,MDEyOklzc3VlQ29tbWVudDM3NTY4NDg1OQ==,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](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.rolling.html).","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,308030789 https://github.com/pydata/xarray/issues/2010#issuecomment-375682093,https://api.github.com/repos/pydata/xarray/issues/2010,375682093,MDEyOklzc3VlQ29tbWVudDM3NTY4MjA5Mw==,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}",,308030789 https://github.com/pydata/xarray/issues/2010#issuecomment-375678008,https://api.github.com/repos/pydata/xarray/issues/2010,375678008,MDEyOklzc3VlQ29tbWVudDM3NTY3ODAwOA==,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}",,308030789 https://github.com/pydata/xarray/issues/2010#issuecomment-375676323,https://api.github.com/repos/pydata/xarray/issues/2010,375676323,MDEyOklzc3VlQ29tbWVudDM3NTY3NjMyMw==,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]: 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}",,308030789