Skip to content

Commit 8513f92

Browse files
committed
keep rows in thresholded counties
1 parent 766bba5 commit 8513f92

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

doctor_visits/delphi_doctor_visits/geo_maps.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,14 @@ def county_to_megacounty(self, data, threshold_visits, threshold_len):
101101
102102
Returns: tuple of dataframe at the daily-state resolution, and geo_id column name
103103
"""
104-
data = self.gmpr.fips_to_megacounty(data,
104+
all_data = self.gmpr.fips_to_megacounty(data,
105105
threshold_visits,
106106
threshold_len,
107107
fips_col="PatCountyFIPS",
108108
thr_col="Denominator",
109109
date_col="ServiceDate")
110-
data.rename({"megafips": "PatCountyFIPS"}, axis=1, inplace=True)
110+
all_data.rename({"megafips": "PatCountyFIPS"}, axis=1, inplace=True)
111+
megacounties = all_data[all_data.PatCountyFIPS.str.endswith("000")]
112+
data = pd.concat([data, megacounties])
113+
111114
return data.groupby("PatCountyFIPS"), "PatCountyFIPS"

0 commit comments

Comments
 (0)