home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 718395235

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
718395235 MDU6SXNzdWU3MTgzOTUyMzU= 4497 ds.rolling() drops attributes and name 19531707 closed 0     1 2020-10-09T20:09:54Z 2020-11-09T15:35:41Z 2020-11-09T15:35:41Z NONE      

Hi all,

I just played around with some data and found that xarray's "rolling" drops the attributes and name (even if I say keep_attrs=True):

``` nt, nx = 100, 30 da = xr.DataArray(np.random.randn(nt, nx), dims=['time', 'x'], name='foo') da.attrs['place'] = 'here' da.attrs['long_name'] = 'test'

da xarray.DataArray'foo'time: 100x: 30 array([[ 0.14720402, -0.29625209, -0.13164254, ..., 0.58363874, 0.20588748, 1.21594309], [ 1.23770654, -0.18156258, 0.9182397 , ..., 0.16810624, -0.40726509, 0.2328856 ], [-0.10127142, 0.55696125, 0.7765333 , ..., -1.24054728, -0.3520287 , 0.34090885], ..., [-0.62290589, 0.95234302, 1.33738597, ..., 1.25784705, 0.32367764, 1.7907127 ], [ 0.2987966 , -0.9820949 , -1.33291223, ..., -0.43975905, 2.28465498, 0.43231269], [ 0.66635482, 0.74084712, -2.02589549, ..., 1.64077719, 2.84362149, -0.36572597]]) Coordinates: (0) Attributes: place : here long_name : test

da.rolling(time=5).mean(dim='time') xarray.DataArraytime: 100x: 30 array([[ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], ..., [-0.56217953, 0.73100328, 0.03839124, ..., 0.60660493, -0.22207041, 0.72327949], [-0.31968275, 0.52925981, 0.00241698, ..., 0.70700785, 0.34605282, 0.69566641], [-0.15442784, 0.78247162, -0.017953 , ..., 0.75334648, 1.03670267, 0.89595308]]) Coordinates: (0) Attributes: (0) ```

Again, this also happens when I include keep_attrs=True at both steps, rolling and mean. I think it should keep the name and attributes?

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/4497/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 1 row from issues_id in issues_labels
  • 1 row from issue in issue_comments
Powered by Datasette · Queries took 0.785ms · About: xarray-datasette