Skip to content

Commit

Permalink
Update census population data source in prep_data.py (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbidari authored Feb 3, 2025
1 parent 39c003d commit 504858c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pipelines/prep_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,15 @@ def verify_no_date_gaps(df: pl.DataFrame):

def get_state_pop_df():
census_dat = pl.read_csv(
"https://www2.census.gov/geo/docs/reference/cenpop2020/CenPop2020_Mean_ST.txt"
)
"https://raw.githubusercontent.com/k5cents/usa/master/data-raw/facts.csv"
).rename({"name": "long_name"})

state_pop_df = forecasttools.location_table.join(
census_dat, left_on="long_name", right_on="STNAME"
census_dat, on="long_name", how="right"
).select(
pl.col("short_name").alias("abb"),
pl.col("long_name").alias("name"),
pl.col("POPULATION").alias("population"),
pl.col("population"),
)

return state_pop_df
Expand Down

0 comments on commit 504858c

Please sign in to comment.