Skip to content

Commit 881c7cc

Browse files
Jingjing TangJingjing Tang
authored andcommitted
Revert "geo refactor"
This reverts commit 86b3b63.
1 parent 84d5124 commit 881c7cc

File tree

1 file changed

+2
-7
lines changed
  • nchs_mortality/delphi_nchs_mortality

1 file changed

+2
-7
lines changed

nchs_mortality/delphi_nchs_mortality/pull.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import numpy as np
44
import pandas as pd
55
from sodapy import Socrata
6-
from delphi_utils import GeoMapper
76

87
def pull_nchs_mortality_data(token: str, map_df: pd.DataFrame, test_mode: str):
98
"""Pull the latest NCHS Mortality data, and conforms it into a dataset.
@@ -92,11 +91,7 @@ def pull_nchs_mortality_data(token: str, map_df: pd.DataFrame, test_mode: str):
9291
)
9392

9493
# Add population info
95-
gmpr = GeoMapper()
9694
KEEP_COLUMNS.extend(["timestamp", "geo_id", "population"])
97-
df.rename({"state":"state_name"}, axis=1, inplace=True)
98-
df = gmpr.add_geocode(df, "state_name", "state_id")
99-
df = gmpr.add_population_column(df, "state_id")
100-
df.rename({"state_id":"geo_id"}, axis=1, inplace=True)
95+
df = df.merge(map_df, on="state")[KEEP_COLUMNS]
10196

102-
return df[KEEP_COLUMNS]
97+
return df

0 commit comments

Comments
 (0)