home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 759745055

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/4804#issuecomment-759745055 https://api.github.com/repos/pydata/xarray/issues/4804 759745055 MDEyOklzc3VlQ29tbWVudDc1OTc0NTA1NQ== 10194086 2021-01-13T21:17:34Z 2021-01-13T21:17:34Z MEMBER

Yes if not valid_values.all() is not lazy. That's the same problem as #4541 and therefore #4559 can be an inspiration how to tackle this. It would be good to test if the check also makes this slower for numpy arrays? Then it could also be removed entirely. That would be counter-intuitive for me, but it seems to be faster for dask arrays...

Other improvements * I am not sure if /= avoids a copy but if so, that's also a possibility to make it faster. * We could add a short-cut for skipna=False (would require adding this option) or dtypes that cannot have NA values as follows:

```python if skipna: # 2. Ignore the nans valid_values = da_a.notnull() & da_b.notnull()

if not valid_values.all():
    da_a = da_a.where(valid_values)
    da_b = da_b.where(valid_values)

valid_count = valid_values.sum(dim) - ddof

else: # shortcut for skipna=False # da_a and da_b are aligned, so the have the same dims and shape axis = da_a.get_axis_num(dim) valid_count = np.take(da_a.shape, axis).prod() - ddof

```

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