Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jhu/delphi_jhu/pull.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def pull_jhu_data(base_url: str, metric: str, pop_df: pd.DataFrame) -> pd.DataFr
pop_df.rename(columns={'FIPS':'fips'}, inplace=True)
pop_df['fips'] = pop_df['fips'].astype(int).\
astype(str).str.zfill(5)
df = pd.merge(df, pop_df, on="fips", how='left')
df = df.merge(pop_df, on="fips", how='left')

# Add a dummy first row here on day before first day
# code below could be cleaned with groupby.diff
Expand Down
2 changes: 1 addition & 1 deletion usafacts/delphi_usafacts/geo.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def geo_map(df: pd.DataFrame, geo_res: str, map_df: pd.DataFrame, sensor: str):
map_df = map_df.loc[~pd.isnull(map_df[colname])].copy()
map_df["geo_id"] = map_df[colname].astype(int)
df["fips"] = df["fips"].astype(int)
merged = pd.merge(df, map_df, on="fips")
merged = df.merge(map_df, on="fips")
merged["cumulative_counts"] = merged["cumulative_counts"] * merged["pop_prop"]
merged["new_counts"] = merged["new_counts"] * merged["pop_prop"]
merged["population"] = merged["population"] * merged["pop_prop"]
Expand Down
2 changes: 1 addition & 1 deletion usafacts/delphi_usafacts/pull.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def pull_usafacts_data(base_url: str, metric: str, pop_df: pd.DataFrame) -> pd.D

# Merge in population LOWERCASE, consistent across confirmed and deaths
# Population for unassigned cases/deaths is NAN
df = pd.merge(df, pop_df, on="FIPS", how="left")
df = df.merge(pop_df, on="FIPS", how="left")

# Change FIPS from 0 to XX000 for statewise unallocated cases/deaths
unassigned_index = (df['FIPS'] == 0)
Expand Down