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 committed by iziram
parent 77348c2cdf
commit 287e4df74e

View File

@ -466,6 +466,7 @@ 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)
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)