Skip to content

Commit

Permalink
handling None type for CO part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
coltleese17 committed Jul 28, 2024
1 parent b622da7 commit 84cb934
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -15,15 +15,15 @@ def formula(person, period, parameters):
age = person("age", period)
p = parameters(period).gov.states.co.ssa.state_supplement

# Handle potential None values
ssi_eligible = ssi_eligible.fillna(False)
is_disabled = is_disabled.fillna(False)
is_blind = is_blind.fillna(False)
# Handle potential None or NaN values
ssi_eligible = np.nan_to_num(ssi_eligible, nan=False)
is_disabled = np.nan_to_num(is_disabled, nan=False)
is_blind = np.nan_to_num(is_blind, nan=False)

disabled_or_blind = is_disabled | is_blind
in_age_range = p.age_range.calc(age)

# Handle potential None in in_age_range
in_age_range = in_age_range.fillna(False)
# Handle potential None or NaN in in_age_range
in_age_range = np.nan_to_num(in_age_range, nan=False)

return disabled_or_blind & ssi_eligible & in_age_range

0 comments on commit 84cb934

Please sign in to comment.