<jupyter_start><jupyter_text>COVID Routing Data By- <NAME> <EMAIL> Project directed by <NAME>- <EMAIL>- https://publish.illinois.edu/r-sowers/Copyright 2020 University of Illinois Board of Trustees. All Rights Reserved.Licensed under the MIT license ***all_140_in_17.P1.csv all_140_in_17.P8.csv all_140_in_17.P9.csv http://census.ire.org/data/bulkdata.htmlCOVID-19_Cases__Tests__and_Deaths_by_ZIP_Code.csv https://healthdata.gov/dataset/covid-19-cases-tests-and-deaths-zip-code<jupyter_code>import pandas as pd
fname1="all_140_in_17.P1.csv"
fname2="all_140_in_17.P8.csv"
fname3="all_140_in_17.P9.csv"
fname4="COVID-19_Cases__Tests__and_Deaths_by_ZIP_Code.csv"

CB_total = pd.read_csv(fname1)
CB_Race = pd.read_csv(fname2)
CB_Latin = pd.read_csv(fname3)
Test_Pos = pd.read_csv(fname4)<jupyter_output><empty_output><jupyter_text>Population of different races in each Census blockData Dictionary for Column Names P001001: Total Population P008003: Total African-American Population P009002: Total Latin-American Population<jupyter_code>CB_Total=CB_total[["GEOID","P001001"]]
CB_White=CB_Race[["GEOID","P008003"]]
CB_Afro=CB_Race[["GEOID","P008004"]]
CB_Latin=CB_Latin[["GEOID","P009002"]]
CB_Total=CB_Total.rename(columns={"P001001":"Total"})
CB_White=CB_White.rename(columns={"P008003":"White American"})
CB_Afro=CB_Afro.rename(columns={"P008004":"African American"})
CB_Latin=CB_Latin.rename(columns={"P009002":"Latin American"})
CB_Toal["Total"]=CB_Total["Total"].fillna<jupyter_output><empty_output><jupyter_text>Create New Table with the population of Minority (African American & Latin American)<jupyter_code>CB_Total=CB_Total.set_index("GEOID")
CB_White=CB_White.set_index("GEOID")
CB_Afro=CB_Afro.set_index("GEOID")
CB_Latin=CB_Latin.set_index("GEOID")
CB_Minor=pd.concat([CB_Latin,CB_Afro], axis=1, sort=False)<jupyter_output><empty_output><jupyter_text>Function that accpets two string inputs (race and geoid) and return the population.<jupyter_code>def search_population(race,geoid):
    geoid=int(geoid)
    if race == "Total" :
        pop=CB_Total.loc[geoid, "Total"]
    elif race == "White":
        pop=CB_White.loc[geoid, "White American"]
    elif race == "African":
        pop=CB_Afro.loc[geoid, "African American"]
    elif race == "Latin":
        pop=CB_Latin.loc[geoid, "Latin American"]
    return pop<jupyter_output><empty_output><jupyter_text>Find census blocks that are predominently African American & Latin American<jupyter_code>CB_Minor["Minority"]=CB_Minor["Latin American"]+CB_Minor["African American"]
CB_Minor=CB_Minor.sort_values(by="Minority",ascending=False)
CB_Minor.head(10)<jupyter_output><empty_output><jupyter_text>Number of Confirmed Cases<jupyter_code>Test_Pos=Test_Pos[["ZIP Code","Cases - Cumulative"]]
Test_Pos=Test_Pos.set_index("ZIP Code")
Test_Pos["Cases - Cumulative"]=Test_Pos["Cases - Cumulative"].fillna("0")
Test_Pos["Cases - Cumulative"]=pd.to_numeric(Test_Pos["Cases - Cumulative"])
#convert DataFrames into numeric values (float)
Test_Pos["Cases - Cumulative"]=Test_Pos["Cases - Cumulative"].fillna("0")
Test_Pos["Cases - Cumulative"]=pd.to_numeric(Test_Pos["Cases - Cumulative"])
def confirmed_cases(zipCode):
    zipCode=str(zipCode)
    cases=Test_Pos.loc[zipCode,:]
    total=int(cases.sum())
    return total

print(confirmed_cases(60631))<jupyter_output>12501<jupyter_text>Final Data  - Target 0: 3531 N SouthPort Ave    GeoID: 170310615001002     Zip Code: 60657- Target 1: 3630 N SouthPort Ave    GeoID: 170310604002006     Zip Code: 60613- Target 2: 3400 N Western Ave    GeoID: 170318437001018     Zip Code: 60618- Target 3: 2940 N Ashland Ave    GeoID: 170310626001023     Zip Code: 60657- Target 4: 2550 N Clyborn Ave    GeoID: 170310707002005     Zip Code: 60614<jupyter_code>print("3531 N SouthPort Ave")
print("Total Population: ", search_population("Total",17031061500))
print("White Population: ", search_population("White",17031061500))
print("African American Population: ", search_population("African",17031061500))
print("Latin American Population: ", search_population("Latin",17031061500))
print("Confirmed Cases in this district: ",confirmed_cases(60657))
print()

print("3630 N SouthPort Ave")
print("Total Population: ", search_population("Total",17031060400))
print("White Population: ", search_population("White",17031060400))
print("African American Population: ", search_population("African",17031060400))
print("Latin American Population: ", search_population("Latin",17031060400))
print("Confirmed Cases in this district: ",confirmed_cases(60613))
print()

print("3400 N Western Ave")
print("Total Population: ", search_population("Total",17031062600))
print("White Population: ", search_population("White",17031062600))
print("African American Population: ", search_population("African",17031062600))
print("Latin American Population: ", search_population("Latin",17031062600))
print("Confirmed Cases in this district: ",confirmed_cases(60657))
print()

print("2550 N Clyborn Ave")
print("Total Population: ", search_population("Total",17031070700))
print("White Population: ", search_population("White",17031070700))
print("African American Population: ", search_population("African",17031070700))
print("Latin American Population: ", search_population("Latin",17031070700))
print("Confirmed Cases in this district: ",confirmed_cases(60614))
print()<jupyter_output>3531 N SouthPort Ave
Total Population:  1707
White Population:  1562
African American Population:  22
Latin American Population:  97
Confirmed Cases in this district:  17138

3630 N SouthPort Ave
Total Population:  3370
White Population:  3036
African American Population:  51
Latin American Population:  304
Confirmed Cases in this district:  15768

3400 N Western Ave
Total Population:  2226
White Population:  1925
African American Population:  32
Latin American Population:  184
Confirmed Cases in this district:  17138

2550 N Clyborn Ave
Total Population:  3481
White Population:  2766
African American Population:  212
Latin American Population:  403
Confirmed Cases in this district:  21966
{'fraction_non_alphanumeric': 0.12272877436405683, 'fraction_numerical': 0.09250082590023125, 'mean_word_length': 7.712230215827338, 'pattern_counts': {'":': 7, '<': 31, '<?xml version=': 0, '>': 31, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '461027', 'license': 'MIT', 'n_tokens_mistral': 2519, 'n_tokens_neox': 2013, 'n_words': 431, 'path': 'Data_Processing.ipynb', 'repo_name': 'jinhohl2/Covid_Routing', 'size': '6094'}