-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exports flattened output for erfs_fpr #177
Conversation
@benjello Instead of merging this PR into
|
@@ -54,7 +54,7 @@ def build(year: int) -> None: | |||
# | |||
# On crée une df par entité par période. | |||
# Elles sont stockées dans un fichier h5 | |||
final.create_input_data_frame(year = year) | |||
final.create_input_data_frame(year = year,export_flattened_df=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
space after comma
@@ -15,7 +15,7 @@ | |||
|
|||
|
|||
@temporary_store_decorator(file_name = 'erfs_fpr') | |||
def create_input_data_frame(temporary_store = None, year = None): | |||
def create_input_data_frame(temporary_store = None, year = None,export_flattened_df=False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
space after comma
@@ -95,7 +95,11 @@ def create_input_data_frame(temporary_store = None, year = None): | |||
) | |||
|
|||
individus = format_ids_and_roles(individus) | |||
|
|||
if export_flattened_df: | |||
supermerge=individus.merge(menages,right_index=True,left_on="idmen",suffixes=("","_x")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
space around =
and after commas.
if export_flattened_df: | ||
supermerge=individus.merge(menages,right_index=True,left_on="idmen",suffixes=("","_x")) | ||
print(len(individus),len(supermerge)) | ||
supermerge.to_hdf("dummy_data.h5",key="input") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"dummy_data.h5" should be an additional argument
Actually it would be better to check it carefully. But I do not have much time right now. |
3b0b471
to
b6a62ad
Compare
New features
export_flattened_df
argument increate_input_data_frame
functiondummy_data.h5
file export that contains only one flattened table (one line per individual) instead of exporting an h5 file with several tables (one with individual and one for households). This fits better certain ways of importing back the data into openfisca (e.g. LexImpact).numexpr
top version to the version used by Core.