Skip to content

Commit 27a47ec

Browse files
committed
more cleanup
1 parent 3e84c39 commit 27a47ec

2 files changed

Lines changed: 2 additions & 11 deletions

File tree

python/housing_data/county_population.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import pandas as pd
55
import us
66
from housing_data.build_data_utils import impute_2025_population
7-
from housing_data.data_loading_helpers import get_url_text
87
from housing_data.fips_crosswalk import load_fips_crosswalk
98

109

@@ -119,11 +118,7 @@ def get_county_fips_crosswalk(data_repo_path: Path) -> pd.DataFrame:
119118

120119

121120
def get_county_populations_1990s(data_path: Path) -> pd.DataFrame:
122-
table_text = get_url_text(
123-
"https://www2.census.gov/programs-surveys/popest/tables/1990-2000/counties/totals/99c8_00.txt",
124-
data_path,
125-
encoding="latin_1",
126-
)
121+
table_text = (data_path / "99c8_00.txt").read_text(encoding="latin_1")
127122

128123
table_text = table_text[: table_text.index("Block 2")].strip()
129124

python/housing_data/state_population.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import pandas as pd
55
import us
66
from housing_data.build_data_utils import impute_2025_population
7-
from housing_data.data_loading_helpers import get_url_text
87

98
DIVISIONS = {
109
"New England": [
@@ -75,10 +74,7 @@ def _line_to_cols(row: str) -> list[str]:
7574

7675

7776
def get_state_populations_1980s(data_path: Path) -> pd.DataFrame:
78-
states_80s_text = get_url_text(
79-
"https://www2.census.gov/programs-surveys/popest/tables/1980-1990/state/asrh/st8090ts.txt",
80-
data_path,
81-
)
77+
states_80s_text = (data_path / "st8090ts.txt").read_text()
8278
handle = StringIO(states_80s_text)
8379

8480
for _ in range(10):

0 commit comments

Comments
 (0)