From 4d6d7ad1685c396865a00a7308b9b8173b4cd64a Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Tue, 14 Dec 2021 14:33:49 +0100 Subject: [PATCH] =?UTF-8?q?nan=20dans=20les=20moyennes=20de=20modules=20(U?= =?UTF-8?q?E=20non=20=C3=A9valu=C3=A9es)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/but/bulletin_but.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/but/bulletin_but.py b/app/but/bulletin_but.py index df9409e5c..61ee57df1 100644 --- a/app/but/bulletin_but.py +++ b/app/but/bulletin_but.py @@ -152,7 +152,7 @@ class ResultatsSemestreBUT: mod_idx = self.modimpl_coefs_df.columns.get_loc(mi.id) # moyennes indicatives (moyennes de moyennes d'UE) moyennes_etuds = np.nan_to_num( - self.sem_cube[:, mod_idx, :].mean(axis=1), + np.nanmean(self.sem_cube[:, mod_idx, :], axis=1), copy=False, ) d[mi.module.code] = { @@ -165,7 +165,8 @@ class ResultatsSemestreBUT: moduleimpl_id=mi.id, ), "moyenne": { - "value": fmt_note(self.sem_cube[etud_idx, mod_idx].mean()), + # moyenne indicative de module: moyenne des UE, ignorant celles sans notes (nan) + "value": fmt_note(np.nanmean(self.sem_cube[etud_idx, mod_idx])), "min": fmt_note(moyennes_etuds.min()), "max": fmt_note(moyennes_etuds.max()), "moy": fmt_note(moyennes_etuds.mean()),