Skip to content

Commit bd76b88

Browse files
committed
🐛 make code pandas3 compatible using loc
1 parent 849d422 commit bd76b88

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

croissance/estimation/smoothing/segments.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def segment_by_std_dev(series, increment=2, maximum=20):
1616
windows = []
1717
for i in range(start, duration, increment):
1818
for size in range(1, maximum + 1):
19-
window = series[i : i + size * increment]
19+
window = series.loc[i : i + size * increment]
2020
# Gaps in measurements may result in empty windows
2121
if not window.empty:
2222
window = detrend(window)
@@ -57,7 +57,7 @@ def segment_points(series, segments):
5757
out = [(series.index[0], numpy.median(series[: series.index[0] + 1]))]
5858

5959
def _add_knot(start, end):
60-
window = series[start:end]
60+
window = series.loc[start:end]
6161
if not window.empty:
6262
out.append(window_median(window, start, end))
6363

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ dependencies = [
3030
"coloredlogs>=14.0.0",
3131
"matplotlib>=1.4.3",
3232
"numpy>=1.9.1",
33-
"pandas>=0.18.0,<3.0.0",
33+
"pandas>=0.18.0",
3434
"scipy>=0.14.0",
3535
]
3636
# use requirements.txt instead of pyproject.toml for dependencies

0 commit comments

Comments
 (0)