Skip to content

Commit 9146beb

Browse files
convert date to string in plot Pt.3
1 parent 696fbf3 commit 9146beb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ahead/Base/Base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,11 @@ def plot(self, series, type_axis="dates", type_plot="pi"):
236236
x_all = [i for i in range(n_points_all)]
237237
x_test = [i for i in range(n_points_train, n_points_all)]
238238

239-
if type_axis == "dates": # use dates
239+
if type_axis == "dates": # use dates
240+
x_train = [date.strftime('%Y-%m-%d') for date in self.input_dates]
240241
x_test = [date.strftime('%Y-%m-%d') for date in self.output_dates_]
241242
x_all = np.concatenate(
242-
(self.input_dates, x_test), axis=None
243+
(x_train, x_test), axis=None
243244
)
244245

245246
if type_plot == "pi":

0 commit comments

Comments
 (0)