issue_comments: 789652922
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/4637#issuecomment-789652922 | https://api.github.com/repos/pydata/xarray/issues/4637 | 789652922 | MDEyOklzc3VlQ29tbWVudDc4OTY1MjkyMg== | 7123715 | 2021-03-03T11:39:38Z | 2021-03-03T11:39:38Z | NONE | A simple trick could be to not use the coordinate while interpolating. An example with the same data but the second dataset has a decreasing index. ```python import numpy as np import xarray as xr da = xr.DataArray([0, 2, np.nan, 3, 3.25], dims="x", coords={"x": [0, 1, 2, 3, 4]}) da1= xr.DataArray([3.25, 3,np.nan,2,0],dims='x',coords={"x":[4,3,2,1,0]}) da_inter=da.interpolate_na(dim='x', method='cubic') da1_inter=da1.interpolate_na(dim='x',method='cubic',use_coordinate=False) ``` As far as I understand interpolation, the result is the same. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
754789691 |