From 35b97ef97ee3c15b37b3a2debec1164cb41b616c Mon Sep 17 00:00:00 2001 From: Mike O'Brien Date: Wed, 28 Oct 2020 11:46:26 -0400 Subject: [PATCH 1/2] stop pylint recursion error in jhu --- jhu/delphi_jhu/pull.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jhu/delphi_jhu/pull.py b/jhu/delphi_jhu/pull.py index ae72a780a..7b24691db 100644 --- a/jhu/delphi_jhu/pull.py +++ b/jhu/delphi_jhu/pull.py @@ -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 From 4d9c494cc6ffc9703b731cf6f6c6a58d18333ca6 Mon Sep 17 00:00:00 2001 From: Mike O'Brien Date: Wed, 28 Oct 2020 11:46:42 -0400 Subject: [PATCH 2/2] stop pylint recursion error in usafacts --- usafacts/delphi_usafacts/geo.py | 2 +- usafacts/delphi_usafacts/pull.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/usafacts/delphi_usafacts/geo.py b/usafacts/delphi_usafacts/geo.py index 1e1e206d8..ff9b50f6c 100644 --- a/usafacts/delphi_usafacts/geo.py +++ b/usafacts/delphi_usafacts/geo.py @@ -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"] diff --git a/usafacts/delphi_usafacts/pull.py b/usafacts/delphi_usafacts/pull.py index c9e265d8c..f8278b344 100644 --- a/usafacts/delphi_usafacts/pull.py +++ b/usafacts/delphi_usafacts/pull.py @@ -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)