home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 357814170

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/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]: <xarray.DataArray (x: 4)> array([0, 1, 2, 3]) Dimensions without coordinates: x a larger array with additional dimension (x_rolling) would be created python <xarray.DataArray (x: 4, x_rolling: 3)> 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 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
Powered by Datasette · Queries took 0.804ms · About: xarray-datasette