Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions croissance/estimation/smoothing/segments.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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))

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