22
22
"msa" : join (DATA_PATH , "zip_msa_table.csv" ),
23
23
"pop" : join (DATA_PATH , "zip_pop.csv" ),
24
24
"state" : join (DATA_PATH , "zip_state_code_table.csv" ),
25
- "hhs_region_number " : join (DATA_PATH , "zip_hhs_table.csv" )
25
+ "hhs " : join (DATA_PATH , "zip_hhs_table.csv" )
26
26
},
27
27
"fips" : {
28
28
"zip" : join (DATA_PATH , "fips_zip_table.csv" ),
29
29
"hrr" : join (DATA_PATH , "fips_hrr_table.csv" ),
30
30
"msa" : join (DATA_PATH , "fips_msa_table.csv" ),
31
31
"pop" : join (DATA_PATH , "fips_pop.csv" ),
32
32
"state" : join (DATA_PATH , "fips_state_table.csv" ),
33
- "hhs_region_number " : join (DATA_PATH , "fips_hhs_table.csv" ),
33
+ "hhs " : join (DATA_PATH , "fips_hhs_table.csv" ),
34
34
},
35
35
"state" : {"state" : join (DATA_PATH , "state_codes_table.csv" )},
36
36
"state_code" : {
37
- "hhs_region_number " : join (DATA_PATH , "state_code_hhs_region_number_table .csv" )
37
+ "hhs " : join (DATA_PATH , "state_code_hhs_table .csv" )
38
38
},
39
39
"jhu_uid" : {"fips" : join (DATA_PATH , "jhu_uid_fips_table.csv" )},
40
40
}
@@ -57,14 +57,14 @@ class GeoMapper: # pylint: disable=too-many-public-methods
57
57
- [x] zip -> hrr : unweighted
58
58
- [x] zip -> msa : unweighted
59
59
- [x] zip -> state
60
- - [x] zip -> hhs_region_number
60
+ - [x] zip -> hhs
61
61
- [x] zip -> population
62
- - [x] state code -> hhs_region_number
62
+ - [x] state code -> hhs
63
63
- [x] fips -> state : unweighted
64
64
- [x] fips -> msa : unweighted
65
65
- [x] fips -> megacounty
66
66
- [x] fips -> hrr
67
- - [x] fips -> hhs_region_number
67
+ - [x] fips -> hhs
68
68
- [x] nation
69
69
- [ ] zip -> dma (postponed)
70
70
@@ -107,13 +107,13 @@ def __init__(self):
107
107
self .crosswalk_filepaths = CROSSWALK_FILEPATHS
108
108
self .crosswalks = {
109
109
"zip" : {
110
- geo : None for geo in ["fips" , "hrr" , "msa" , "pop" , "state" , "hhs_region_number " ]
110
+ geo : None for geo in ["fips" , "hrr" , "msa" , "pop" , "state" , "hhs " ]
111
111
},
112
112
"fips" : {
113
- geo : None for geo in ["zip" , "hrr" , "msa" , "pop" , "state" , "hhs_region_number " ]
113
+ geo : None for geo in ["zip" , "hrr" , "msa" , "pop" , "state" , "hhs " ]
114
114
},
115
115
"state" : {"state" : None },
116
- "state_code" : {"hhs_region_number " : None },
116
+ "state_code" : {"hhs " : None },
117
117
"jhu_uid" : {"fips" : None },
118
118
}
119
119
@@ -131,7 +131,7 @@ def _load_crosswalk(self, from_code, to_code):
131
131
("jhu_uid" , "fips" ),
132
132
("zip" , "msa" ),
133
133
("fips" , "hrr" ),
134
- ("zip" , "hhs_region_number " )
134
+ ("zip" , "hhs " )
135
135
]:
136
136
self .crosswalks [from_code ][to_code ] = pd .read_csv (
137
137
stream ,
@@ -145,8 +145,8 @@ def _load_crosswalk(self, from_code, to_code):
145
145
elif (from_code , to_code ) in [
146
146
("zip" , "hrr" ),
147
147
("fips" , "msa" ),
148
- ("fips" , "hhs_region_number " ),
149
- ("state_code" , "hhs_region_number " )
148
+ ("fips" , "hhs " ),
149
+ ("state_code" , "hhs " )
150
150
]:
151
151
self .crosswalks [from_code ][to_code ] = pd .read_csv (
152
152
stream ,
@@ -261,11 +261,11 @@ def add_geocode(
261
261
"""Add a new geocode column to a dataframe.
262
262
263
263
Currently supported conversions:
264
- - fips -> state_code, state_id, state_name, zip, msa, hrr, nation, hhs_region_number
265
- - zip -> state_code, state_id, state_name, fips, msa, hrr, nation, hhs_region_number
264
+ - fips -> state_code, state_id, state_name, zip, msa, hrr, nation, hhs
265
+ - zip -> state_code, state_id, state_name, fips, msa, hrr, nation, hhs
266
266
- jhu_uid -> fips
267
267
- state_x -> state_y, where x and y are in {code, id, name}
268
- - state_code -> hhs_region_number
268
+ - state_code -> hhs
269
269
270
270
Parameters
271
271
---------
@@ -274,7 +274,7 @@ def add_geocode(
274
274
from_code: {'fips', 'zip', 'jhu_uid', 'state_code', 'state_id', 'state_name'}
275
275
Specifies the geocode type of the data in from_col.
276
276
new_code: {'fips', 'zip', 'state_code', 'state_id', 'state_name', 'hrr', 'msa',
277
- 'hhs_region_number '}
277
+ 'hhs '}
278
278
Specifies the geocode type in new_col.
279
279
from_col: str, default None
280
280
Name of the column in dataframe containing from_code. If None, then the name
@@ -364,7 +364,7 @@ def replace_geocode(
364
364
- zip -> state_code, state_id, state_name, fips, msa, hrr, nation
365
365
- jhu_uid -> fips
366
366
- state_x -> state_y, where x and y are in {code, id, name}
367
- - state_code -> hhs_region_number
367
+ - state_code -> hhs
368
368
369
369
Parameters
370
370
---------
@@ -377,7 +377,7 @@ def replace_geocode(
377
377
new_col: str
378
378
Name of the new column to add to data.
379
379
new_code: {'fips', 'zip', 'state_code', 'state_id', 'state_name', 'hrr', 'msa',
380
- 'hhs_region_number '}
380
+ 'hhs '}
381
381
Specifies the geocode type of the data in new_col.
382
382
date_col: str or None, default "date"
383
383
Specify which column contains the date values. Used for value aggregation.
0 commit comments