From 4e2388df73341e4ddaf217137a18bb8f526615bb Mon Sep 17 00:00:00 2001 From: "chataigner.g" Date: Sun, 15 May 2022 18:06:50 +0200 Subject: [PATCH] moyenne --- knn.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/knn.py b/knn.py index 6edadd5..3f9d40b 100644 --- a/knn.py +++ b/knn.py @@ -1,6 +1,5 @@ def lecture(fichier): temp_jour = [] - conso = [] with open(fichier, "r") as menu: menu.readline() for ligne in menu: @@ -67,7 +66,7 @@ def numeroJour(date): return num_jour -def moyenne_liste +def moyenne_liste(): temp_jour, = lecture("pic-journalier-consommation.csv") temp_num_jour = [] for i in range(365): @@ -89,7 +88,9 @@ def moyenne_liste moy_temp_moy += lst_temp_moy[n] moy_temp_ref += lst_temp_ref[n] moy_conso = moy_conso / len(lst_conso) - temp_num_jour + moy_temp_moy = moy_temp_moy / len(lst_temp_moy) + moy_temp_ref = moy_temp_ref / len(lst_temp_ref) + temp_num_jour.append([i, moy_conso, moy_temp_moy, moy_temp_ref])