Skip to content

Commit b5668ee

Browse files
committed
Utils geo_data_proc: fix possible bug, minor population fix
1 parent a409da6 commit b5668ee

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

_delphi_utils_python/data_proc/geomap/geo_data_proc.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"""
44

55
from io import BytesIO
6+
from os import remove, listdir
67
from os.path import join, isfile
78
from zipfile import ZipFile
89

@@ -498,7 +499,14 @@ def derive_zip_hhs_crosswalk():
498499
zip_state.merge(state_hhs, on="state_code", how="left").drop(columns=["state_code", "state_id", "state_name"]).sort_values(["zip", "hhs"]).to_csv(join(OUTPUT_DIR, ZIP_HHS_FILENAME), index=False)
499500

500501

502+
def clear_dir(dir_path: str):
503+
for fname in listdir(dir_path):
504+
remove(join(dir_path, fname))
505+
506+
501507
if __name__ == "__main__":
508+
clear_dir(OUTPUT_DIR)
509+
502510
create_fips_zip_crosswalk()
503511
create_zip_hsa_hrr_crosswalk()
504512
create_fips_msa_crosswalk()

_delphi_utils_python/delphi_utils/data/hhs_pop.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ hhs,pop
88
6,43123701
99
7,14166466
1010
8,12378529
11-
9,52178142
11+
9,52124259

_delphi_utils_python/delphi_utils/data/state_pop.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ state_code,state_id,state_name,pop
5252
56,wy,Wyoming,582328
5353
60,as,American Samoa,55519
5454
66,gu,Guam,159358
55-
69,mp,Northern Mariana Islands,107766
55+
69,mp,Northern Mariana Islands,53883
5656
70,pw,Republic of Palau,520755
5757
72,pr,Puerto Rico,3723066
5858
78,vi,U.S. Virgin Islands,106405

0 commit comments

Comments
 (0)