@@ -117,14 +117,12 @@ def run_module(params, logger=None):
117117 lambda x : us .states .lookup (x ).abbr .lower () if us .states .lookup (x ) else "dc"
118118 )
119119 elif geo == "hrr" :
120- df = df [df ["county" ] != "All" ]
121120 df = df [["fips" , "val" , "timestamp" ]]
122121 df = geo_mapper .add_population_column (df , geocode_type = "fips" , geocode_col = "fips" )
123122 df = geo_mapper .add_geocode (df , "fips" , "hrr" , from_col = "fips" , new_col = "geo_id" )
124123 df = geo_mapper .aggregate_by_weighted_sum (df , "geo_id" , "val" , "timestamp" , "population" )
125124 df = df .rename (columns = {"weighted_val" : "val" })
126125 elif geo == "msa" :
127- df = df [df ["county" ] != "All" ]
128126 df = df [["fips" , "val" , "timestamp" ]]
129127 # fips -> msa doesn't have a weighted version, so we need to add columns and sum ourselves
130128 df = geo_mapper .add_population_column (df , geocode_type = "fips" , geocode_col = "fips" )
@@ -142,7 +140,6 @@ def run_module(params, logger=None):
142140 else :
143141 df = df [df ["county" ] != "All" ]
144142 df ["geo_id" ] = df ["fips" ]
145-
146143 # add se, sample_size, and na codes
147144 missing_cols = set (CSV_COLS ) - set (df .columns )
148145 df = add_needed_columns (df , col_names = list (missing_cols ))
0 commit comments