From d2937e4a8ebc0609567f580f20b35d560466e776 Mon Sep 17 00:00:00 2001 From: chloelallemand <55277136+clallemand@users.noreply.github.com> Date: Tue, 19 Nov 2024 10:40:05 +0100 Subject: [PATCH] Update openfisca_france_data/erfs_fpr/input_data_builder/step_05_foyer.py Co-authored-by: Mahdi Ben Jelloul --- .../erfs_fpr/input_data_builder/step_05_foyer.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/openfisca_france_data/erfs_fpr/input_data_builder/step_05_foyer.py b/openfisca_france_data/erfs_fpr/input_data_builder/step_05_foyer.py index 2264fbe0..b211247b 100644 --- a/openfisca_france_data/erfs_fpr/input_data_builder/step_05_foyer.py +++ b/openfisca_france_data/erfs_fpr/input_data_builder/step_05_foyer.py @@ -33,12 +33,15 @@ def build_foyer(temporary_store = None, year = None): how = "inner" ) - decls['statut_decl1'] = np.where((decls.statut_decl1 != decls.statut_decl2), - np.where(decls.statut_decl1.isin([1,2]) | decls.statut_decl2.isin([1,2]), - 1, - 8 - ), - decls.statut_decl1) + decls['statut_decl1'] = np.where( + (decls.statut_decl1 != decls.statut_decl2), + np.where( + decls.statut_decl1.isin([1,2]) | decls.statut_decl2.isin([1,2]), + 1, + 8 + ), + decls.statut_decl1 + ) assert len(couples[couples.quifam.isin([0])]) == len(decls) couples = pd.merge(couples,decls[['idfam',"statut_decl1"]],on = 'idfam', how = 'inner')