Skip to content

more frequency string updates? #8612

Closed
@mathause

Description

@mathause

What is your issue?

I looked a bit into the frequency string update & found 3 issues we could improve upon.

  1. Apart from "M", pandas also deprecated "Y", and "Q", in favor of "YE" and "QE". (And they are discussing renaming "MS" to "MB"). Should we do the same?

  2. Should we translate the new freq strings to the old ones if pandas < 2.2 is installed? Otherwise we get the following situation:

    import xarray as xr
    xr.date_range("1600-02-01", periods=3, freq="M") # deprecation warning
    xr.date_range("1600-02-01", periods=3, freq="ME") # ValueError: Invalid frequency: ME
  3. date_range_like can emit deprecation warnings without a way to mitigate them if pandas < 2.2 is installed. (When a DatetimeIndex) is passed. Could be nice to translate the old freq string to the new one without a warning.

I have played around with 2. and 3. and can open a PR if you are on board.

@spencerkclark @aulemahal

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions