From d00ae0f06b388c97e36bf818ce9e19d10ef54026 Mon Sep 17 00:00:00 2001 From: Nikhil Woodruff Date: Sun, 8 Aug 2021 11:46:48 +0100 Subject: [PATCH] Add changes --- openfisca_data/datasets/us/cps/base_cps/dataset.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openfisca_data/datasets/us/cps/base_cps/dataset.py b/openfisca_data/datasets/us/cps/base_cps/dataset.py index b5407d3..6cb00b1 100644 --- a/openfisca_data/datasets/us/cps/base_cps/dataset.py +++ b/openfisca_data/datasets/us/cps/base_cps/dataset.py @@ -67,7 +67,7 @@ def generate(year): family["family_id"] = family.F_FH_SEQ * 10 + family.F_FFPOS household["household_id"] = household.H_H_SEQ - person["person_weight"] = person.P_A_FNLWGT + person["person_weight"] = person.P_MARSUPWT tax_unit = pd.DataFrame(index=person.person_tax_unit_id.unique()) spm_unit = pd.DataFrame(index=person.person_spm_unit_id.unique()) tax_unit["tax_unit_id"] = tax_unit.index @@ -75,7 +75,9 @@ def generate(year): tax_unit[ "tax_unit_weight" ] = 1e5 # not accurate, just a placeholder until development - spm_unit["spm_unit_weight"] = 1e5 + spm_unit["spm_unit_weight"] = person.P_SPM_WEIGHT.groupby( + person.person_spm_unit_id + ).first()[spm_unit.index] family["family_weight"] = family.F_FSUP_WGT household["household_weight"] = household.H_HSUP_WGT