-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
DOC: add interp example #2312
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
DOC: add interp example #2312
Conversation
Thanks for adding this to doc. To do so, it would be best place to put it in here |
@fujiisoup I would like to add another example on how to update a I tried using I used
|
Thanks. I think you can do da_dt64.interp(time=pd.date_range('1/1/2000', '1/3/2000', periods=3)) |
@@ -48,6 +48,23 @@ array-like, which gives the interpolated result as an array. | |||
# interpolation | |||
da.interp(time=[2.5, 3.5]) | |||
|
|||
|
|||
To interpolate data with a :py:func:`numpy.datetime64` coordinate you have to | |||
wrap it explicitly in a :py:func:`numpy.datetime64` object. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is currently true, but I think we could support da_dt64.interp(time='2000-01-02')
in the future.
Do you mind to send another PR to do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trying to wrap up another PR. Unfortunately, I don't want to over promise and may not be able to get to this until a couple of weeks. If you have ideas of how to do this we can move the discussion to #2284
Thanks, @raybellwaves. |
* master: Add libraries to show_versions (pydata#2321) fix doc build error after pydata#2312 (pydata#2326)
whats-new.rst
for all changes andapi.rst
for new API (remove if this change should not be visible to users, e.g., if it is an internal clean-up, or if this is part of a larger project that will be documented later)I wanted to add an example as googling 'xarray interp' takes me to http://xarray.pydata.org/en/stable/generated/xarray.Dataset.interp.html.
However, there lots of great examples in http://xarray.pydata.org/en/stable/interpolation.html
Perhaps I should edit it to:
I was also thinking about adding a note about interpolating time as it came up in #2284 but not sure what would be the best way to do so.