pydata / xarray

N-D labeled arrays and datasets in Python
https://xarray.dev
Apache License 2.0
3.61k stars 1.08k forks source link

Resample no longer works with Pandas DateOffset or Timedelta objects #9408

Closed oliverhiggs closed 1 month ago

oliverhiggs commented 2 months ago

What is your issue?

Since version 2024.07.0, resampling raises an error when used with a Pandas DateOffset or Timedelta object. Resampling using these can be done by first creating a TimeResampler object, but this is an extra step and is inconsistent with the way resampling works in Pandas; resample in Pandas accepts objects of these types as arguments.

Would the maintainers consider supporting DateOffset and Timedelta objects directly in resample?

dcherian commented 2 months ago

Thanks I agree this should be fixed

Are you able to send in a PR with a fix?

oliverhiggs commented 2 months ago

Sure, I've added a fix in #9413