Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interpolate_na documentation #6899

Closed
bertcoerver opened this issue Aug 9, 2022 · 3 comments
Closed

interpolate_na documentation #6899

bertcoerver opened this issue Aug 9, 2022 · 3 comments

Comments

@bertcoerver
Copy link

bertcoerver commented Aug 9, 2022

What is your issue?

According to the documentation for xarray.Dataset.interpolate_na, additional keywords are passed on to numpy.interp when method="linear". In one of the examples one such additional keyword is fill_value (="extrapolate").

But according the the linked documentation for numpy.interp, that function only takes left, right and period as keyword arguments.

The given example does work though... Does it really use numpy.interp or does it perhaps use scipy.interpolate.interp1d, which does have a keyword called fill_value?

@bertcoerver bertcoerver added the needs triage Issue that has not been reviewed by xarray team member label Aug 9, 2022
@TomNicholas TomNicholas added topic-documentation and removed needs triage Issue that has not been reviewed by xarray team member labels Aug 9, 2022
@husainridwan
Copy link

From what I was able to gather, numpy.interp only takes three keyword arguments as **kwargs i.e. left, right, and period but not fill_value. So when passing fill_value as a keyword argument to xarray.Dataset.interpolate_na with method="linear", it does not use numpy.interp but it uses scipy.interpolate.interp1d(), which provides the fill_value parameter.

@husainridwan
Copy link

I'll like to update this in the documentation @TomNicholas

@TomNicholas
Copy link
Contributor

@alrho007 great! We would welcome a pull request to update this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants