Skip to content

Commit 08c9e8a

Browse files
committed
Don't impute population=0 or NA with 1
This was breaking the plots for cities like Dublin, CA, and Poway, CA, which were missing population data from 1980-1989. The units per capita numbers were nonsensical when imputed with 1.
1 parent 297ee92 commit 08c9e8a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

python/housing_data/build_data_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def write_list_json(
167167

168168
def add_per_capita_columns(df: pd.DataFrame, data_sources: list[DataSource]) -> None:
169169
# There are three cities (Sitka, Weeki Wachee, and Carlton Landing) that had population 0 in some years
170-
population = df["population"].where(df["population"] != 0, 1)
170+
population = df["population"].replace({0: pd.NA})
171171

172172
cols = {
173173
col

0 commit comments

Comments
 (0)