Skip to content

Commit

Permalink
[ENH] Update pandas version (#913)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
MatthewMiddlehurst and TonyBagnall authored Sep 25, 2024
1 parent a15250e commit 8685600
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions aeon/utils/tests/test_datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
infer_freq,
set_hier_freq,
)
from aeon.utils.validation._dependencies import _check_soft_dependencies


def test_get_freq():
Expand Down Expand Up @@ -77,15 +78,15 @@ 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"

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():
Expand All @@ -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"])
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 8685600

Please sign in to comment.