Skip to content

Commit

Permalink
2002 ste04 one father not present in dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
bilalchoho committed Jun 22, 2021
1 parent 849f2a1 commit fbeacd0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def famille_3(base = None, famille = None, kind = 'erfs_fpr', year = None):
lpr = "lpr"
else:
lpr = "lprm"

assert base is not None
assert famille is not None
assert year is not None
Expand Down Expand Up @@ -440,7 +440,7 @@ def famille_3(base = None, famille = None, kind = 'erfs_fpr', year = None):
assert_dtype(mere[series_name], "int")
except Exception:
assert_dtype(mere[series_name], "int64")

avec_mere = avec_mere[avec_mere.noifam.isin(mere.noindiv)].copy()
famille = famille[~(famille.noindiv.isin(mere.noindiv.values))].copy() # Avoid duplication in famille

Expand Down Expand Up @@ -477,6 +477,8 @@ def famille_3(base = None, famille = None, kind = 'erfs_fpr', year = None):
log.info(u"Il y a {} enfants rattachés à leur père".format(
len(avec_pere.index)))
avec_pere['noifam'] = (100 * avec_pere.ident + avec_pere.noiper).astype(int)
#Check if father is in the database
avec_pere = avec_pere[(avec_pere.noifam.isin(base.noindiv))].copy()
avec_pere['famille'] = 44
avec_pere['kid'] = True
assert avec_pere['noifam'].notnull().all(), 'presence of NaN in avec_pere'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def create_input_data_frame(temporary_store = None, year = None, export_flattene

individus = create_ids_and_roles(individus)
individus = individus[variables].copy()
menages = menages.loc[(menages.ident).isin(set(individus.idmen))].copy()
gc.collect()

# This looks like it could have a sizeable impact
Expand Down

0 comments on commit fbeacd0

Please sign in to comment.