From 14aabab74682367c01af7c3743ad6f724f393a26 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 21 Apr 2022 22:28:17 +0200 Subject: [PATCH] Pandas: replace deprecated Int64Index by Index(dtype=int) --- app/comp/inscr_mod.py | 2 +- app/comp/moy_mod.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/comp/inscr_mod.py b/app/comp/inscr_mod.py index 56567f80..a76f2430 100644 --- a/app/comp/inscr_mod.py +++ b/app/comp/inscr_mod.py @@ -34,7 +34,7 @@ def df_load_modimpl_inscr(formsemestre) -> pd.DataFrame: ) df = df.merge(ins_df, how="left", left_index=True, right_index=True) # Force columns names to integers (moduleimpl ids) - df.columns = pd.Int64Index([int(x) for x in df.columns], dtype="int") + df.columns = pd.Index([int(x) for x in df.columns], dtype=int) # les colonnes de df sont en float (Nan) quand il n'y a # aucun inscrit au module. df.fillna(0, inplace=True) # les non-inscrits diff --git a/app/comp/moy_mod.py b/app/comp/moy_mod.py index 13829a39..f5efbeb2 100644 --- a/app/comp/moy_mod.py +++ b/app/comp/moy_mod.py @@ -169,9 +169,7 @@ class ModuleImplResults: self.en_attente = True # Force columns names to integers (evaluation ids) - evals_notes.columns = pd.Int64Index( - [int(x) for x in evals_notes.columns], dtype="int" - ) + evals_notes.columns = pd.Index([int(x) for x in evals_notes.columns], dtype=int) self.evals_notes = evals_notes def _load_evaluation_notes(self, evaluation: Evaluation) -> pd.DataFrame: