-
Notifications
You must be signed in to change notification settings - Fork 16
Add HHS mapping files #609
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
Conversation
nmdefries
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you considered leftpadding the HHS region numbers with zero so that they're all the same length? It can make string processing and sorting more convenient.
| ) | ||
| state_hhs = pd.read_csv( | ||
| join(OUTPUT_DIR, STATE_HHS_OUT_FILENAME), | ||
| dtype={"state_code": str, "state_id": str, "state_name": str}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the state -> HHS file should have column names state_code and hhs_region_number. Same problem on line 576.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, thanks
|
|
||
| ( | ||
| zip_state.merge(state_hhs, on="state_code", how="left") | ||
| .drop(columns=["state_code", "state_id", "state_name"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update to reflect changed column names on line 576. Should be the same as line 556.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case, the zip_state file is the one introducing these columns. The other function uses the fips population file (was just copying an different fips -> * example) which only has the population column to drop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it.
I went with the existing implementation (state -> hhs) that had them without the zero padding, which also follows the existing HRR convention of not left padding. I think it's to distinguish geos that are defined with zero pad (e.g. a zip code "06001" is defined as 5 digits and "6001" wouldn't be right, same for a county FIPS like "01009") from those without (e.g. HHS Regions are just "Region 1." I don't feel super strongly either way, though if we left padded HHS we should also probably do for HRR and update any downstream documentation accordingly. |
Description
First part of adding HHS support to geomapper. This just adds the mapping files, does not add to the actual geomapper util
Changelog
Itemize code/test/documentation changes and files added/removed.
Fixes