diff --git a/croissance/estimation/smoothing/segments.py b/croissance/estimation/smoothing/segments.py index 4032b9c..786b401 100644 --- a/croissance/estimation/smoothing/segments.py +++ b/croissance/estimation/smoothing/segments.py @@ -16,7 +16,7 @@ def segment_by_std_dev(series, increment=2, maximum=20): windows = [] for i in range(start, duration, increment): for size in range(1, maximum + 1): - window = series[i : i + size * increment] + window = series.loc[i : i + size * increment] # Gaps in measurements may result in empty windows if not window.empty: window = detrend(window) @@ -57,7 +57,7 @@ def segment_points(series, segments): out = [(series.index[0], numpy.median(series[: series.index[0] + 1]))] def _add_knot(start, end): - window = series[start:end] + window = series.loc[start:end] if not window.empty: out.append(window_median(window, start, end)) diff --git a/pyproject.toml b/pyproject.toml index 15012f0..3824451 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ dependencies = [ "coloredlogs>=14.0.0", "matplotlib>=1.4.3", "numpy>=1.9.1", - "pandas>=0.18.0,<3.0.0", + "pandas>=0.18.0", "scipy>=0.14.0", ] # use requirements.txt instead of pyproject.toml for dependencies