From 29d87783fddf30748c023b6311e2aa91e87da21f Mon Sep 17 00:00:00 2001 From: Analect Date: Wed, 24 Aug 2022 22:05:10 +0100 Subject: [PATCH] fix problem with plotting in chap6 forecast1.py ValueError: The (time) index must be sorted (monotonically increasing), but found: DatetimeIndex(['2022-08-24 20:00:00', '2022-08-24 21:00:00' --- chapter-6/forecast1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter-6/forecast1.py b/chapter-6/forecast1.py index 6320e63..99c6321 100644 --- a/chapter-6/forecast1.py +++ b/chapter-6/forecast1.py @@ -22,7 +22,7 @@ def plot(self): from sktime.utils.plotting import plot_series from io import BytesIO buf = BytesIO() - fig, _ = plot_series(self.pd_past5days, labels=['past5days']) + fig, _ = plot_series(self.pd_past5days.sort_index(axis=0), labels=['past5days']) fig.savefig(buf) self.plot = buf.getvalue() self.next(self.end)