diff --git a/jhu/delphi_jhu/geo.py b/jhu/delphi_jhu/geo.py index 950a75faf..67d8f866e 100644 --- a/jhu/delphi_jhu/geo.py +++ b/jhu/delphi_jhu/geo.py @@ -37,7 +37,7 @@ def geo_map(df: pd.DataFrame, geo_res: str, sensor: str): elif geo_res == "msa": df = gmpr.county_to_msa(df, fips_col="fips", msa_col="geo_id", date_col="timestamp") df['geo_id'] = df['geo_id'].astype(int) - print(df[df['population']==0]) + print(df[df['population'] == 0]) elif geo_res == 'hrr': df = gmpr.county_to_hrr(df, fips_col="fips", hrr_col="geo_id", date_col="timestamp") df['geo_id'] = df['geo_id'].astype(int) @@ -48,5 +48,3 @@ def geo_map(df: pd.DataFrame, geo_res: str, sensor: str): df['new_counts'] = df['new_counts'] df['cumulative_counts'] = df['cumulative_counts'] return df - - diff --git a/jhu/delphi_jhu/pull.py b/jhu/delphi_jhu/pull.py index 96a32937f..295159f8b 100644 --- a/jhu/delphi_jhu/pull.py +++ b/jhu/delphi_jhu/pull.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- +import re from delphi_utils import GeoMapper import pandas as pd import numpy as np -import re def detect_date_col(col_name: str): """determine if column name is a date""" @@ -72,7 +72,7 @@ def pull_jhu_data(base_url: str, metric: str, pop_df: pd.DataFrame) -> pd.DataFr gmpr = GeoMapper() - df = gmpr.jhu_uid_to_county(df,jhu_col="UID",date_col='timestamp') + df = gmpr.jhu_uid_to_county(df, jhu_col="UID", date_col='timestamp') """ df = df[ @@ -87,7 +87,7 @@ def pull_jhu_data(base_url: str, metric: str, pop_df: pd.DataFrame) -> pd.DataFr """ # Merge in population LOWERCASE, consistent across confirmed and deaths # Set population as NAN for fake fips - pop_df.rename(columns={'FIPS':'fips'},inplace=True) + 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')