From 83f8f2ddbc0ae8cfb965a39730c13d6da8ea19b1 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Tue, 14 Dec 2021 09:30:47 +0100 Subject: [PATCH] fix: plante recap si aucun etudiant --- app/comp/moy_ue.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/comp/moy_ue.py b/app/comp/moy_ue.py index 8bd9fa94..90f6a250 100644 --- a/app/comp/moy_ue.py +++ b/app/comp/moy_ue.py @@ -196,6 +196,10 @@ def compute_ue_moys( assert modimpl_coefs_df.shape[1] == nb_modules modimpl_inscr = modimpl_inscr_df.values modimpl_coefs = modimpl_coefs_df.values + if nb_etuds == 0: + return pd.DataFrame( + index=modimpl_inscr_df.index, columns=modimpl_coefs_df.index + ) # Duplique les inscriptions sur les UEs: modimpl_inscr_stacked = np.stack([modimpl_inscr] * nb_ues, axis=2) # Enlève les NaN du numérateur: