Skip to content

Fix nchs missing value #535

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

Merged
merged 9 commits into from
Nov 18, 2020
Merged

Fix nchs missing value #535

merged 9 commits into from
Nov 18, 2020

Conversation

jingjtang
Copy link
Contributor

@jingjtang jingjtang commented Nov 17, 2020

Description

bug fix. Do not assign 0 to missing values. The nchs mortality weekly table reports incidence. The existence of a missing value means the data does not meet the privacy threshold.

Changelog

  • pull.py and run.py
  • tests/test_run.py, tests/test_pull.py (add tests for missing values)

Fixes

  • Fixes problem mentioned here

@krivard krivard requested review from a team, dshemetov and eujing and removed request for a team and dshemetov November 17, 2020 18:16
Copy link
Contributor

@eujing eujing left a comment

Choose a reason for hiding this comment

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

Overall looks good, except 1 possible issue to clarify.
But otherwise tests pass for me too!

Comment on lines -75 to -76
df = df.groupby(
["state", "timestamp"]).sum().reindex(index_df).reset_index()
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this reindex step was used to fill in missing values by state and time and removing it makes sense given the discussion.
I am not super familiar with the actual NCHS data, but were there cases of duplicated (state, timestamp) where the sum aggregation should still be retained?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, you are right! Let me fix this. Thanks!

@krivard krivard requested a review from eujing November 18, 2020 14:23
Copy link
Contributor

@eujing eujing left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@jingjtang jingjtang mentioned this pull request Nov 18, 2020
9 tasks
@jingjtang jingjtang marked this pull request as draft November 18, 2020 16:22
@jingjtang jingjtang marked this pull request as ready for review November 18, 2020 17:11
@eujing eujing self-requested a review November 18, 2020 17:32
Copy link
Contributor

@eujing eujing left a comment

Choose a reason for hiding this comment

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

After further discussion, looks good to me!

@krivard krivard merged commit c2ca85b into main Nov 18, 2020
@krivard krivard deleted the fix-nchs-missing-value branch November 18, 2020 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants