From 8d8a846ae0ab5eee60bc49b7d4b26026baca6aa4 Mon Sep 17 00:00:00 2001 From: Diana Jlailaty Date: Tue, 7 Dec 2021 09:15:08 +0000 Subject: [PATCH] Update gluonts_forecaster.py --- forecasting_gluonts/gluonts_forecaster.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/forecasting_gluonts/gluonts_forecaster.py b/forecasting_gluonts/gluonts_forecaster.py index 52bc3e05..7b6b6869 100644 --- a/forecasting_gluonts/gluonts_forecaster.py +++ b/forecasting_gluonts/gluonts_forecaster.py @@ -59,12 +59,12 @@ def train(metric): for j in range(i + 1, (len(dataset[metric]) - 1)): if (dataset[metric][j] == "None" and dataset[metric][j + 1] != "None" and dataset[metric][j - 1] != "None"): myds.append(dataset['ems_time'][j]) - myy.append((dataset[metric][j - 1] + dataset[metric][j + 1]) / 2) + myy.append((float(dataset[metric][j - 1]) + (float(dataset[metric][j + 1]) )/ 2)) elif (dataset[metric][j] == "None" and (dataset[metric][j + 1] == "None" or dataset[metric][j - 1] == "None")): j = j + 1 elif (dataset[metric][j] != "None"): myds.append(dataset['ems_time'][j]) - myy.append(dataset[metric][j]) + myy.append(float(dataset[metric][j])) j = j + 1 if (dataset[metric][len(dataset[metric]) - 1] != "None"): -- GitLab