Skip to content
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

Merged
merged 8 commits into from
Oct 24, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space after comma



if __name__ == '__main__':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space after comma

assert temporary_store is not None
assert year is not None

Expand Down Expand Up @@ -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"))
Copy link
Member

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.

print(len(individus),len(supermerge))
supermerge.to_hdf("dummy_data.h5",key="input")
Copy link
Member

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

# Enters the individual table into the openfisca_erfs_fpr collection
set_table_in_survey(
individus,
entity = "individu",
Expand All @@ -104,6 +108,7 @@ def create_input_data_frame(temporary_store = None, year = None):
survey_name = 'input',
)


# assert 'f4ba' in data_frame.columns


Expand Down