home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 575094227

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/3694#issuecomment-575094227 https://api.github.com/repos/pydata/xarray/issues/3694 575094227 MDEyOklzc3VlQ29tbWVudDU3NTA5NDIyNw== 10194086 2020-01-16T10:47:33Z 2020-01-16T10:47:33Z MEMBER

I started with a PR using join = OPTIONS["arithmetic_join"] but then I realized that dot does not support skipna. Thus join="left" join="right", and join="outer" returns NaN for nonequal coords, which I think defeats the purpose. I can

1) Use OPTIONS["arithmetic_join"] anyway 2) Only support join="inner" (i.e. hard-code it in the call to apply_ufunc) 3) try to implement skipna for dot (in a separate PR) 4) Other?

(3) is certainly the largest change but may be as easy as da.fillna(0.). Thoughts?

``` python import numpy as np import xarray as xr

d1 = xr.DataArray([2, 3, 5, np.NaN]) d2 = xr.DataArray([2, 3, 5, 7])

xr.dot(d1, d2) # -> NaN

xr.dot(d1.fillna(0.), d2) # -> 38 (d1 * d2).sum() # -> 38

```

I use this at: https://github.com/pydata/xarray/blob/3cc00c121931b5dc0247b4ea5809c4051a4dacdd/xarray/core/weighted.py#L142-L149

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