issue_comments: 837032429
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/pull/5284#issuecomment-837032429 | https://api.github.com/repos/pydata/xarray/issues/5284 | 837032429 | MDEyOklzc3VlQ29tbWVudDgzNzAzMjQyOQ== | 56925856 | 2021-05-10T17:44:29Z | 2021-05-10T17:44:29Z | CONTRIBUTOR | Hi @dcherian , just thinking about your suggestion for using ```python3 da_a = xr.DataArray( np.array([[1, 2, 3, 4], [1, 0.1, 0.2, 0.3], [2, 3.2, 0.6, 1.8]]), dims=("space", "time"), coords=[ ("space", ["IA", "IL", "IN"]), ("time", pd.date_range("2000-01-01", freq="1D", periods=4)), ], ).chunk({'time':1}) da_b = xr.DataArray( np.array([[0.2, 0.4, 0.6, 2], [15, 10, 5, 1], [1, 3.2, np.nan, 1.8]]), dims=("space", "time"), coords=[ ("space", ["IA", "IL", "IN"]), ("time", pd.date_range("2000-01-01", freq="1D", periods=4)), ], ).chunk({'time':1}) print(da_a)
print(da_b)
Define function to use in map_blocksdef _get_valid_values(da, other): da1, da2 = xr.align(da, other, join="inner", copy=False)
testoutp = da_a.map_blocks(_get_valid_values, args=[da_b]) print(outp.compute())
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
882876804 |