fix: plante recap si aucun etudiant

This commit is contained in:
Emmanuel Viennet 2021-12-14 09:30:47 +01:00
parent ae42db06da
commit 83f8f2ddbc

View File

@ -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: