33
44import pandas as pd
55import us
6- from housing_data .build_data_utils import impute_2024_and_2025_population
6+ from housing_data .build_data_utils import impute_2025_population
77from housing_data .data_loading_helpers import get_url_text
88from housing_data .fips_crosswalk import load_fips_crosswalk
99
@@ -20,10 +20,10 @@ def _melt_df(df: pd.DataFrame, years: list[int]) -> pd.DataFrame:
2020
2121
2222def get_county_populations_2020s (data_path : Path ) -> pd .DataFrame :
23- df = pd .read_csv (data_path / "co-est2023 -alldata.csv" , encoding = "latin_1" )
23+ df = pd .read_csv (data_path / "co-est2024 -alldata.csv" , encoding = "latin_1" )
2424
25- df = _melt_df (df , list (range (2020 , 2024 )))
26- return impute_2024_and_2025_population (df )
25+ df = _melt_df (df , list (range (2020 , 2025 )))
26+ return impute_2025_population (df )
2727
2828
2929def get_county_populations_2010s (data_path : Path ) -> pd .DataFrame :
@@ -106,12 +106,12 @@ def get_county_populations_2000s(data_path: Path, data_repo_path: Path) -> pd.Da
106106
107107def get_county_fips_crosswalk (data_repo_path : Path ) -> pd .DataFrame :
108108 df = load_fips_crosswalk (data_repo_path )
109- df = df [df ["County Code ( FIPS) " ] != 0 ]
109+ df = df [df ["County FIPS Code " ] != 0 ]
110110
111111 rename_cols = {
112- "State Code ( FIPS) " : "state_code" ,
113- "County Code ( FIPS) " : "county_code" ,
114- "Area Name (including legal/statistical area description) " : "county_name" ,
112+ "State FIPS Code " : "state_code" ,
113+ "County FIPS Code " : "county_code" ,
114+ "Area Name" : "county_name" ,
115115 }
116116 df = df [rename_cols .keys ()].rename (columns = rename_cols )
117117
0 commit comments