Closed
Description
What is your issue?
I looked a bit into the frequency string update & found 3 issues we could improve upon.
-
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? -
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
-
date_range_like
can emit deprecation warnings without a way to mitigate them if pandas < 2.2 is installed. (When aDatetimeIndex
) 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.