Skip to content
Merged
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
9 changes: 5 additions & 4 deletions rdtools/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,10 +487,8 @@ def _bootstrap(x, percentile, reps):
if ci_color is None:
ci_color = 'C0'

try:
roller = results_values.rolling(f'{rolling_days}d', min_periods=rolling_days//4,
center=True)
except ValueError:
results_values = results_values.sort_index()
if results_values.index.has_duplicates:
# this occurs with degradation_year_on_year(multi_yoy=True). resample to daily mean
warnings.warn(
"Input `yoy_info['YoY_values']` appears to have multiple annual "
Expand All @@ -503,6 +501,9 @@ def _bootstrap(x, percentile, reps):
roller = results_values.resample('D').mean().rolling(f'{rolling_days}d',
min_periods=rolling_days//4,
center=True)
else:
roller = results_values.rolling(f'{rolling_days}d', min_periods=rolling_days//4,
center=True)
# unfortunately it seems that you can't return multiple values in the rolling.apply() kernel.
# TODO: figure out some workaround to return both percentiles in a single pass
if include_ci:
Expand Down