forked from ScoDoc/ScoDoc
Fix: calcul moyenne classiques sur vides
This commit is contained in:
parent
80c03f022b
commit
20d2e644bc
@ -344,8 +344,12 @@ def compute_ue_moys_classic(
|
|||||||
pd.Series(
|
pd.Series(
|
||||||
[val] * len(modimpl_inscr_df.index), index=modimpl_inscr_df.index
|
[val] * len(modimpl_inscr_df.index), index=modimpl_inscr_df.index
|
||||||
),
|
),
|
||||||
pd.DataFrame(columns=[ue.id for ue in ues], index=modimpl_inscr_df.index),
|
pd.DataFrame(
|
||||||
pd.DataFrame(columns=[ue.id for ue in ues], index=modimpl_inscr_df.index),
|
columns=[ue.id for ue in ues], index=modimpl_inscr_df.index, dtype=float
|
||||||
|
),
|
||||||
|
pd.DataFrame(
|
||||||
|
columns=[ue.id for ue in ues], index=modimpl_inscr_df.index, dtype=float
|
||||||
|
),
|
||||||
)
|
)
|
||||||
# Restreint aux modules sélectionnés:
|
# Restreint aux modules sélectionnés:
|
||||||
sem_matrix = sem_matrix[:, modimpl_mask]
|
sem_matrix = sem_matrix[:, modimpl_mask]
|
||||||
@ -400,6 +404,7 @@ def compute_ue_moys_classic(
|
|||||||
},
|
},
|
||||||
index=modimpl_inscr_df.index,
|
index=modimpl_inscr_df.index,
|
||||||
columns=[ue.id for ue in ues],
|
columns=[ue.id for ue in ues],
|
||||||
|
dtype=float,
|
||||||
)
|
)
|
||||||
# remplace NaN par zéros dans les moyennes d'UE
|
# remplace NaN par zéros dans les moyennes d'UE
|
||||||
etud_moy_ue_df_no_nan = etud_moy_ue_df.fillna(0.0, inplace=False)
|
etud_moy_ue_df_no_nan = etud_moy_ue_df.fillna(0.0, inplace=False)
|
||||||
@ -415,6 +420,7 @@ def compute_ue_moys_classic(
|
|||||||
coefs.sum(axis=2).T,
|
coefs.sum(axis=2).T,
|
||||||
index=modimpl_inscr_df.index, # etudids
|
index=modimpl_inscr_df.index, # etudids
|
||||||
columns=[ue.id for ue in ues],
|
columns=[ue.id for ue in ues],
|
||||||
|
dtype=float,
|
||||||
)
|
)
|
||||||
with np.errstate(invalid="ignore"): # ignore les 0/0 (-> NaN)
|
with np.errstate(invalid="ignore"): # ignore les 0/0 (-> NaN)
|
||||||
etud_moy_gen = np.sum(
|
etud_moy_gen = np.sum(
|
||||||
|
Loading…
Reference in New Issue
Block a user