1
0
forked from ScoDoc/ScoDoc

Suppress warning on 0/0 in compute_mat_moys_classic

This commit is contained in:
Emmanuel Viennet 2022-11-28 10:03:28 +01:00
parent 7653342142
commit 0f539a4fcd

View File

@ -466,9 +466,10 @@ def compute_mat_moys_classic(
if modimpl_coefs_etuds_no_nan.dtype == object: # arrive sur des tableaux vides
modimpl_coefs_etuds_no_nan = modimpl_coefs_etuds_no_nan.astype(np.float)
etud_moy_mat = (modimpl_coefs_etuds_no_nan * sem_matrix_inscrits).sum(
axis=1
) / modimpl_coefs_etuds_no_nan.sum(axis=1)
with np.errstate(invalid="ignore"): # il peut y avoir des NaN
etud_moy_mat = (modimpl_coefs_etuds_no_nan * sem_matrix_inscrits).sum(
axis=1
) / modimpl_coefs_etuds_no_nan.sum(axis=1)
return pd.Series(etud_moy_mat, index=modimpl_inscr_df.index)