diff --git a/app/but/bulletin_but.py b/app/but/bulletin_but.py index df9409e5..61ee57df 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()),