NYCPlanning / db-equitable-development-tool

Data Repo for the equitable development tool (EDDT)
MIT License
0 stars 0 forks source link

NYCHA Tenants #266

Closed td928 closed 2 years ago

td928 commented 2 years ago

Overview

addressing #260 from a single spreadsheet and relatively straightforward work

load_clean_nycha_data

To clean up the puma level NYCHA tenants data.

the bulk of work takes place where the RAD and public housing population gets summed up by race.

for i in range(6):
        nycha_data[f"nycha_tenants{race_labels[i]}_count"] = nycha_data.iloc[:, i] + nycha_data.iloc[:, i + 6] 

nycha_tenants

I don't love the design that the join with census data takes place in here. I initially had in the load_clean_nycha_data but then realize if the join takes place earlier would mess up the percentage columns for the total population from census. I settled for this current design but open to other suggestions.

get_percentage

to get the percentage of NYCHA population out of total population of the geography

final output has 24 columns each 2 measures (count, pct) 2 indicators(nycha tenants & pop) 6 races

td928 commented 2 years ago

Okay so turns out not a complicated refactor to do it more explicitly at all. @SashaWeinstein I agree it is more readable this way and let me know the new commit addressed your concern. Thanks!

td928 commented 2 years ago

@SashaWeinstein cool I like what you did with zip. Let me know if you can approve and I will merge it in. Thanks!

SashaWeinstein commented 2 years ago

That looks a lot better! I made an additional change to use the python built-in zip instead of enumerate because I finally figured out what zip does and I wanted to use it.

td928 commented 2 years ago

I think it was added already @SashaWeinstein