forked from ScoDoc/ScoDoc
Suppress warning on 0/0 in compute_mat_moys_classic
This commit is contained in:
parent
7653342142
commit
0f539a4fcd
@ -466,9 +466,10 @@ def compute_mat_moys_classic(
|
|||||||
if modimpl_coefs_etuds_no_nan.dtype == object: # arrive sur des tableaux vides
|
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)
|
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(
|
with np.errstate(invalid="ignore"): # il peut y avoir des NaN
|
||||||
axis=1
|
etud_moy_mat = (modimpl_coefs_etuds_no_nan * sem_matrix_inscrits).sum(
|
||||||
) / modimpl_coefs_etuds_no_nan.sum(axis=1)
|
axis=1
|
||||||
|
) / modimpl_coefs_etuds_no_nan.sum(axis=1)
|
||||||
|
|
||||||
return pd.Series(etud_moy_mat, index=modimpl_inscr_df.index)
|
return pd.Series(etud_moy_mat, index=modimpl_inscr_df.index)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user