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

illustrate time offset arithmetic #7596

Closed
dcherian opened this issue Mar 8, 2023 · 2 comments · Fixed by #8479
Closed

illustrate time offset arithmetic #7596

dcherian opened this issue Mar 8, 2023 · 2 comments · Fixed by #8479

Comments

@dcherian
Copy link
Contributor

dcherian commented Mar 8, 2023

Is your feature request related to a problem?

We should document changing the time vector using pandas date offsets here

This is particularly useful for centering the time stamps after a resampling operation.

Related:

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

@Karimat22

This comment was marked as off-topic.

@cyschneck
Copy link

Will the time offset arithmetic involve the use of pandas offset function? A potential solution from Issue 4535 uses from pandas.tseries.frequencies import to_offset

I'd find an example helpful since I am attempting to convert an existing function from loffset to the time offset arithmetic for MonthBegin ("MS")

douglatornell added a commit to douglatornell/xarray that referenced this issue Nov 23, 2023
Illustrate updating the time coordinate values of a resampled dataset
using time offset arithmetic. This is the recommended technique to
replace the use of the deprecated `loffset` parameter in `resample()`

re: issue pydata#7596 and discussion
pydata#8175
dcherian added a commit that referenced this issue Nov 29, 2023
* Improve FutureWarning re: resample() loffset parameter

As discussed in #8175

* Add docs re: resample time offset arithmetic

Illustrate updating the time coordinate values of a resampled dataset
using time offset arithmetic. This is the recommended technique to
replace the use of the deprecated `loffset` parameter in `resample()`

re: issue #7596 and discussion
#8175

* Add loffset deprecation warning to resample docstrings

* Add docs change to whats-new.rst

* Drop redundant FutureWarning in warning text

* Change deprecation warning to present tense

* Add code example for FutureWarning message

---------

Co-authored-by: Deepak Cherian <dcherian@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants