def add_census_data_analysis(output):
    # Compute vacant home %, new resident %, population density.
    for ward in output.values():
        for anc in ward["ancs"].values():
            anc["census"]["H0050001_PCT"] = { "value": int(round(100.0 * anc["census"]["H0050001"]["value"] / anc["census"]["H0040001"]["value"])) }
            anc["census"]["B07001_001E_PCT"] = { "value": int(round(100.0 * (anc["census"]["B07001_065E"]["value"] - anc["census"]["B07001_081E"]["value"]) / anc["census"]["B07001_001E"]["value"])) }
            anc["census"]["POP_DENSITY"] = { "value": int(round(anc["census"]["P0010001"]["value"] / anc["area"] * 2589990.0)) } # pop per sq mi
dataset/ETHPy150Open codefordc/ancfinder/scripts/update_anc_database.py/add_census_data_analysis/operator `+` -> `-`