-
-
Notifications
You must be signed in to change notification settings - Fork 163
Open
Labels
backward-incompatibleChanges proposed in this PR/Issue are not backwards compatibleChanges proposed in this PR/Issue are not backwards compatible
Description
@MaxGhenis's work in #2463 splits UBI_21 into UBI_2164 and UBI_65 by calculating an intermediate variable n2164 that counts the number of people in a filing unit between the ages of 21 and 64. Reasonably, he includes this check: assert n2164 >= 0 because a filing unit should not have negative people in it. Unfortunately, that is not the case with the PUF. There are numerous filing units with n2164 values of -1, so calc_all() fails when using PUF.
My guess is that this issue will have to be sorted out in taxdata (cc @andersonfrailey), so it might make sense to revert #2463 until we come up with a solution.
cc @MattHJensen
# code to see filing units with negative people
import pandas as pd
import numpy as np
puf_df = pd.read_csv('puf.csv')
puf_df['n65'] = np.where(puf_df.age_head >= 65,1,0) +
np.where(puf_df.age_spouse >= 65,1,0) +
puf_df['elderly_dependents']
puf_df['n2164'] = puf_df['n21'] - puf_df['n65']
puf_df[puf_df['n2164']<0]Metadata
Metadata
Assignees
Labels
backward-incompatibleChanges proposed in this PR/Issue are not backwards compatibleChanges proposed in this PR/Issue are not backwards compatible