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/1831#issuecomment-357907365,https://api.github.com/repos/pydata/xarray/issues/1831,357907365,MDEyOklzc3VlQ29tbWVudDM1NzkwNzM2NQ==,6815844,2018-01-16T09:48:56Z,2018-01-16T09:49:21Z,MEMBER,"Thanks for the information. I will look into the issue. I think the sliding-and-stack method itself would be also handy. I will start from this.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,288567090 https://github.com/pydata/xarray/issues/1831#issuecomment-357828636,https://api.github.com/repos/pydata/xarray/issues/1831,357828636,MDEyOklzc3VlQ29tbWVudDM1NzgyODYzNg==,1217238,2018-01-16T01:37:39Z,2018-01-16T01:37:39Z,MEMBER,"Yes, I think the stride tricks version would be a significant improvement. See this numpy PR for discussion/examples: https://github.com/numpy/numpy/pull/31","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,288567090 https://github.com/pydata/xarray/issues/1831#issuecomment-357814170,https://api.github.com/repos/pydata/xarray/issues/1831,357814170,MDEyOklzc3VlQ29tbWVudDM1NzgxNDE3MA==,6815844,2018-01-15T23:47:06Z,2018-01-15T23:47:06Z,MEMBER,"I'm thinking to use the fancy indexing to speed up `rolling.reduce`, by temporary constructing a single large array with `da.ndim+1` dimensions, E.g. for the following `DataArray` ```python In [2]: da Out [2]: array([0, 1, 2, 3]) Dimensions without coordinates: x ``` a larger array with additional dimension (`x_rolling`) would be created ```python array([[ nan, 0., 1.], [ 0., 1., 2.], [ 1., 2., 3.], [ 2., 3., nan]]) Dimensions without coordinates: x, x_rolling ``` then reduce along `x_rolling` dimension. The advantages would be + Indexing occurs only once. + Reducing operation can be easily vectorized. The disadvantages would be + It constructs a huge array with size of (window_size - 1) * da.size, consuming a lot of memory. I think this disadvantage would be solved if we could use [`np.lib.stride_trick.as_strided`](https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.lib.stride_tricks.as_strided.html) for `np.ndarray` backend case. (how about with dask?)","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,288567090 https://github.com/pydata/xarray/issues/1831#issuecomment-357739849,https://api.github.com/repos/pydata/xarray/issues/1831,357739849,MDEyOklzc3VlQ29tbWVudDM1NzczOTg0OQ==,2443309,2018-01-15T17:02:38Z,2018-01-15T17:02:38Z,MEMBER,"@fujiisoup - I think this is a great idea. As you've noted, the `reduce` implementation in about as naive as it comes (#668). While the `__iter__` method should continue to return DataArray objects, the `reduce` method can be optimized. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,288567090