From 86856008063f0fd9e71a38416f9a070abe13cb7d Mon Sep 17 00:00:00 2001 From: Matthew Middlehurst Date: Wed, 25 Sep 2024 21:55:58 +0300 Subject: [PATCH] [ENH] Update `pandas` version (#913) * update pandas * 2.3.0 * pandas deprecation bits * updates * ffill * map * attempt to fix tests * reset * ME * wierd edge case --------- Co-authored-by: Tony Bagnall --- aeon/utils/tests/test_datetime.py | 8 ++++++-- pyproject.toml | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/aeon/utils/tests/test_datetime.py b/aeon/utils/tests/test_datetime.py index 6915478f1a..fb06be03bb 100644 --- a/aeon/utils/tests/test_datetime.py +++ b/aeon/utils/tests/test_datetime.py @@ -15,6 +15,7 @@ infer_freq, set_hier_freq, ) +from aeon.utils.validation._dependencies import _check_soft_dependencies def test_get_freq(): @@ -77,7 +78,7 @@ def test_infer_freq() -> None: index = pd.date_range(start="2021-01-01", periods=1, freq="M") y = pd.Series(index=index, dtype=int) - assert infer_freq(y) == "M" + assert infer_freq(y) == "ME" y = pd.DataFrame({"a": 1}, index=pd.date_range(start="2021-01-01", periods=1)) assert infer_freq(y) == "D" @@ -85,7 +86,7 @@ def test_infer_freq() -> None: y = pd.DataFrame( {"a": 1}, index=pd.date_range(start="2021-01-01", periods=1, freq="M") ) - assert infer_freq(y) == "M" + assert infer_freq(y) == "ME" def test_set_freq_hier(): @@ -99,6 +100,9 @@ def test_set_freq_hier(): assert get_time_index(y).freq is not None + if _check_soft_dependencies("pandas>=2.1.0", severity="none"): + y.index.freq = None + # Create MultiIndex mi = pd.MultiIndex.from_product([[0], y.index], names=["instances", "timepoints"]) y_group1 = pd.DataFrame(y.values, index=mi, columns=["y"]) diff --git a/pyproject.toml b/pyproject.toml index f7385eac97..30b0bad47a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,7 +49,7 @@ dependencies = [ "numba>=0.55,<0.61.0", "numpy>=1.21.0,<1.27.0", "packaging>=20.0", - "pandas>=1.5.3,<2.1.0", + "pandas>=2.0.0,<2.3.0", "scikit-learn>=1.0.0,<1.6.0", "scipy>=1.9.0,<1.14.0", "typing-extensions>=4.6.0",