Skip to content

Commit

Permalink
Add multi-dimensional extrapolation example
Browse files Browse the repository at this point in the history
  • Loading branch information
matrss committed Apr 9, 2020
1 parent 7f9d469 commit e86a3be
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion doc/interpolation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,14 @@ Additional keyword arguments can be passed to scipy's functions.
# fill 0 for the outside of the original coordinates.
da.interp(x=np.linspace(-0.5, 1.5, 10), kwargs={'fill_value': 0.0})
# extrapolation
# 1-dimensional extrapolation
da.interp(x=np.linspace(-0.5, 1.5, 10), kwargs={'fill_value': 'extrapolate'})
# multi-dimensional extrapolation
da = xr.DataArray(np.sin(0.3 * np.arange(12).reshape(4, 3)),
[('time', np.arange(4)),
('space', [0.1, 0.2, 0.3])])
da.interp(time=4, space=np.linspace(-0.1, 0.5, 10), kwargs={'fill_value': None})
Advanced Interpolation
Expand Down

0 comments on commit e86a3be

Please sign in to comment.