<jupyter_start><jupyter_text>Compare evictions in Hillsborough County to NYC using DP02 variables (see census data dictionary)<jupyter_code>import pandas as pd
import numpy as np
from pandas_profiling import ProfileReport
df_hill = pd.read_csv("../../data/processed/hillsborough_fl_processed_2017_to_2019_20210225.csv")
df_hill = df_hill.rename({'census_tract_GEOID': 'GEOID'}, axis=1)

#create specific columns from df - load
eviction_columns = ["GEOID", "total-households", "median-gross-rent", "avg-eviction-rate", "ratio-to-mean-eviction-rate", "county"]
df_hill_trans = df_hill[eviction_columns].copy()

df_hill_trans.head()
df_nyc = pd.read_csv("../../data/processed/nyc_processed_2017_to_2019_20210225.csv")
df_nyc = df_nyc.rename({'census_tract_GEOID': 'GEOID'}, axis=1)

#create specific columns from df - load
eviction_columns = ["GEOID", "total-households", "median-gross-rent", "avg-eviction-rate", "ratio-to-mean-eviction-rate", "county"]
df_nyc_trans = df_nyc[eviction_columns].copy()

df_nyc_trans.head()
df_dp_dict = pd.read_csv("../../data/acs/data_dictionary.csv")
df_dp_dict.head()                    
df_dp_hill = pd.read_csv("../../data/acs/hillsborough_acs5-2018_census.csv")

#create specific columns from df - load
dp_columns = ["GEOID", "DP02_0001E", "DP02_0001PE", "DP02_0002E", "DP02_0002PE"]
df_dp_hill_trans = df_dp_hill[dp_columns].copy()

df_dp_hill_trans.head()         
df_dp_nyc = pd.read_csv("../../data/acs/nyc_acs5-2018_census.csv")

#create specific columns from df - load
dp_columns = ["GEOID", "DP02_0001E", "DP02_0001PE", "DP02_0002E", "DP02_0002PE"]
df_dp_nyc_trans = df_dp_nyc[dp_columns].copy()

df_dp_nyc_trans.head()         
##profile = ProfileReport(df_hill, title="Pandas Profiling Report", minimal=True)
##profile.to_notebook_iframe()
df_hill_merge = pd.merge(df_hill_trans, df_dp_hill_trans, on="GEOID")
df_hill_merge.head()
df_nyc_merge = pd.merge(df_nyc_trans, df_dp_nyc_trans, on="GEOID")
df_nyc_merge.head()
profile_hill = ProfileReport(df_hill_merge, title="Hill Profiling Report", minimal=True)
profile_hill.to_file("hill.html")
profile_nyc = ProfileReport(df_nyc_merge, title="NYC Profiling Report", minimal=True)
profile_nyc.to_file("nyc.html")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1450962830273175, 'fraction_numerical': 0.04209583519928348, 'mean_word_length': 6.421926910299003, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '81729', 'license': 'MIT', 'n_tokens_mistral': 926, 'n_tokens_neox': 837, 'n_words': 137, 'path': 'scripts/_abasaltr/compare-evictions.ipynb', 'repo_name': 'ahopejasen/datakind-test', 'size': '2233'}