2023-02-01 01:23:45 +00:00
{
"cells": [
{
"cell_type": "markdown",
2023-02-16 00:29:26 +00:00
"metadata": {},
2023-02-01 01:23:45 +00:00
"source": [
2023-02-16 00:29:26 +00:00
"# Sami Almuallim"
]
2023-02-01 01:23:45 +00:00
},
{
"cell_type": "markdown",
2023-02-16 00:29:26 +00:00
"metadata": {},
2023-02-01 01:23:45 +00:00
"source": [
2023-02-16 00:29:26 +00:00
"## Research question/interests\n",
"\n",
2023-02-16 00:53:33 +00:00
"**How are the different metrics of pride represented in this data set correlated?** Answering this question will provide a foundation upon which we can work to answer the more complicated questions that follow.\n",
2023-02-16 00:29:26 +00:00
"\n",
2023-02-16 00:53:33 +00:00
"- This will probably be the simplest research question, requiring only the data contained in our original data set. To explore this topic, we will use different visualization methods discussed in class to develop a better understanding of the data.\n",
2023-02-16 00:29:26 +00:00
"\n",
2023-02-16 00:53:33 +00:00
"**Is there a positive or a negative correlation between taxes paid and the pride of a given queer neighbourhood?** Taxes are influenced by a variety of socio-economic factors and we hope that in analyzing both tax data and our quantification of queerness on a geographic level, we'll be able to gleam insight into the question of how queerness and class are interrelated.\n",
2023-02-16 00:29:26 +00:00
"\n",
2023-02-16 00:53:33 +00:00
"- Similar again to the first research question posed, we'll need to find another data set containing geographically located tax data, which should be easy to acquire from the US government (for example, [in our cursory research, we found this data set from the IRS](https://www.irs.gov/statistics/soi-tax-stats-individual-income-tax-statistics-2018-zip-code-data-soi)).\n",
"- This would bring the number of data sets used in this project up to three, which might present some challenges in terms of the amount of data wrangling necessary to bring it all together.\n",
"- To measure this, we would rank the neighbourhoods presented in the gaybourhoods data set by pride (an open question which we will explore in a separate research question)"
]
},
{
"cell_type": "code",
2023-03-07 08:41:48 +00:00
"execution_count": 1,
2023-02-16 00:53:33 +00:00
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>GEOID10</th>\n",
" <th>Tax_Mjoint</th>\n",
" <th>Mjoint_MF</th>\n",
" <th>Mjoint_SS</th>\n",
" <th>Mjoint_FF</th>\n",
" <th>Mjoint_MM</th>\n",
" <th>TaxRate_SS</th>\n",
" <th>TaxRate_FF</th>\n",
" <th>TaxRate_MM</th>\n",
" <th>Cns_TotHH</th>\n",
" <th>...</th>\n",
" <th>FF_Cns</th>\n",
" <th>FF_Index</th>\n",
" <th>MM_Tax</th>\n",
" <th>MM_Cns</th>\n",
" <th>MM_Index</th>\n",
" <th>SS_Index</th>\n",
" <th>SS_Index_Weight</th>\n",
" <th>Parade_Weight</th>\n",
" <th>Bars_Weight</th>\n",
" <th>TOTINDEX</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>90069</td>\n",
" <td>2120</td>\n",
" <td>1689</td>\n",
" <td>431</td>\n",
" <td>61</td>\n",
" <td>370</td>\n",
" <td>203.301887</td>\n",
" <td>28.773585</td>\n",
" <td>174.528302</td>\n",
" <td>12551</td>\n",
" <td>...</td>\n",
" <td>1.847099</td>\n",
" <td>6.724415</td>\n",
" <td>29.583721</td>\n",
" <td>18.704533</td>\n",
" <td>48.288254</td>\n",
" <td>55.012669</td>\n",
" <td>39.429995</td>\n",
" <td>10</td>\n",
" <td>17.647059</td>\n",
" <td>67.077054</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>94114</td>\n",
" <td>5080</td>\n",
" <td>4036</td>\n",
" <td>1044</td>\n",
" <td>170</td>\n",
" <td>874</td>\n",
" <td>205.511811</td>\n",
" <td>33.464567</td>\n",
" <td>172.047244</td>\n",
" <td>16456</td>\n",
" <td>...</td>\n",
" <td>4.161579</td>\n",
" <td>9.834048</td>\n",
" <td>29.163165</td>\n",
" <td>19.415304</td>\n",
" <td>48.578469</td>\n",
" <td>58.412517</td>\n",
" <td>41.866815</td>\n",
" <td>0</td>\n",
" <td>20.000000</td>\n",
" <td>61.866815</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>10011</td>\n",
" <td>5790</td>\n",
" <td>5166</td>\n",
" <td>624</td>\n",
" <td>97</td>\n",
" <td>527</td>\n",
" <td>107.772021</td>\n",
" <td>16.753022</td>\n",
" <td>91.018998</td>\n",
" <td>29762</td>\n",
" <td>...</td>\n",
" <td>1.531029</td>\n",
" <td>4.370779</td>\n",
" <td>15.428332</td>\n",
" <td>10.932081</td>\n",
" <td>26.360413</td>\n",
" <td>30.731192</td>\n",
" <td>22.026394</td>\n",
" <td>10</td>\n",
" <td>5.882353</td>\n",
" <td>37.908747</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>10014</td>\n",
" <td>3510</td>\n",
" <td>3229</td>\n",
" <td>281</td>\n",
" <td>74</td>\n",
" <td>207</td>\n",
" <td>80.056980</td>\n",
" <td>21.082621</td>\n",
" <td>58.974359</td>\n",
" <td>18786</td>\n",
" <td>...</td>\n",
" <td>2.482293</td>\n",
" <td>6.055939</td>\n",
" <td>9.996551</td>\n",
" <td>5.943318</td>\n",
" <td>15.939869</td>\n",
" <td>21.995808</td>\n",
" <td>15.765361</td>\n",
" <td>10</td>\n",
" <td>11.764706</td>\n",
" <td>37.530067</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>94103</td>\n",
" <td>2660</td>\n",
" <td>2417</td>\n",
" <td>243</td>\n",
" <td>34</td>\n",
" <td>209</td>\n",
" <td>91.353383</td>\n",
" <td>12.781955</td>\n",
" <td>78.571429</td>\n",
" <td>12728</td>\n",
" <td>...</td>\n",
" <td>0.837431</td>\n",
" <td>3.004058</td>\n",
" <td>13.318386</td>\n",
" <td>4.961779</td>\n",
" <td>18.280165</td>\n",
" <td>21.284224</td>\n",
" <td>15.255337</td>\n",
" <td>10</td>\n",
" <td>10.588235</td>\n",
" <td>35.843573</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>5 rows × 29 columns</p>\n",
"</div>"
],
"text/plain": [
" GEOID10 Tax_Mjoint Mjoint_MF Mjoint_SS Mjoint_FF Mjoint_MM \\\n",
"0 90069 2120 1689 431 61 370 \n",
"1 94114 5080 4036 1044 170 874 \n",
"2 10011 5790 5166 624 97 527 \n",
"3 10014 3510 3229 281 74 207 \n",
"4 94103 2660 2417 243 34 209 \n",
"\n",
" TaxRate_SS TaxRate_FF TaxRate_MM Cns_TotHH ... FF_Cns FF_Index \\\n",
"0 203.301887 28.773585 174.528302 12551 ... 1.847099 6.724415 \n",
"1 205.511811 33.464567 172.047244 16456 ... 4.161579 9.834048 \n",
"2 107.772021 16.753022 91.018998 29762 ... 1.531029 4.370779 \n",
"3 80.056980 21.082621 58.974359 18786 ... 2.482293 6.055939 \n",
"4 91.353383 12.781955 78.571429 12728 ... 0.837431 3.004058 \n",
"\n",
" MM_Tax MM_Cns MM_Index SS_Index SS_Index_Weight Parade_Weight \\\n",
"0 29.583721 18.704533 48.288254 55.012669 39.429995 10 \n",
"1 29.163165 19.415304 48.578469 58.412517 41.866815 0 \n",
"2 15.428332 10.932081 26.360413 30.731192 22.026394 10 \n",
"3 9.996551 5.943318 15.939869 21.995808 15.765361 10 \n",
"4 13.318386 4.961779 18.280165 21.284224 15.255337 10 \n",
"\n",
" Bars_Weight TOTINDEX \n",
"0 17.647059 67.077054 \n",
"1 20.000000 61.866815 \n",
"2 5.882353 37.908747 \n",
"3 11.764706 37.530067 \n",
"4 10.588235 35.843573 \n",
"\n",
"[5 rows x 29 columns]"
]
},
2023-03-07 08:41:48 +00:00
"execution_count": 1,
2023-02-16 00:53:33 +00:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import pandas as pd\n",
2023-03-03 08:51:14 +00:00
"import seaborn as sns\n",
"import numpy as np\n",
2023-02-16 00:29:26 +00:00
"\n",
2023-02-16 00:53:33 +00:00
"gaybourhoods = pd.read_csv(\"../data/raw/gaybourhoods.csv\")\n",
"gaybourhoods.head(5)"
2023-02-16 00:29:26 +00:00
]
},
2023-03-02 00:10:26 +00:00
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Data wrangling"
]
},
{
"cell_type": "code",
2023-03-07 08:41:48 +00:00
"execution_count": 2,
2023-03-02 00:10:26 +00:00
"metadata": {},
2023-04-13 18:37:53 +00:00
"outputs": [],
2023-03-02 00:10:26 +00:00
"source": [
"# NOTE: This cell will not work unless this file is in the repository. The source\n",
"# can be found linked in the references section of the readme, however, it is too\n",
"# big for GitHub to handle.\n",
2023-03-03 08:51:14 +00:00
"\n",
2023-04-13 18:37:53 +00:00
"#irs = pd.read_csv(\"../data/raw/irs_2015.csv\")\n",
2023-03-02 00:10:26 +00:00
"\n",
"# Naively splitting the IRS data set in two. More formal data wrangling will\n",
"# come later\n",
2023-04-13 18:37:53 +00:00
"#irs1 = irs.head(int(irs.shape[0] / 2))\n",
"#irs2 = irs.tail(int(irs.shape[0] / 2))\n",
2023-03-02 00:10:26 +00:00
"\n",
2023-04-13 18:37:53 +00:00
"#irs1.to_csv(\"../data/processed/irs_2015_1\", index=False)\n",
"#irs2.to_csv(\"../data/processed/irs_2015_2\", index=False)"
2023-03-02 00:10:26 +00:00
]
},
{
"cell_type": "code",
2023-03-07 08:41:48 +00:00
"execution_count": 3,
2023-03-02 00:10:26 +00:00
"metadata": {},
2023-03-03 08:51:14 +00:00
"outputs": [],
2023-03-02 00:10:26 +00:00
"source": [
"# Now these two datasets can be joined and worked with\n",
"irs = pd.concat([\n",
" pd.read_csv(\"../data/processed/irs_2015_1\"),\n",
" pd.read_csv(\"../data/processed/irs_2015_2\")\n",
"])\n",
2023-03-03 08:51:14 +00:00
"# irs.head()\n",
"\n",
"\n",
"#selected data: ZIPCODE - this will be used in conjunction with the rest of the set\n",
" # N2 - population of zip code\n",
" \n",
" #data of intrest\n",
" # A11900\tTotal overpayments amount\n",
" # AGI_STUB - metric for income\n",
"\n",
"# print(irs.loc[irs['zipcode']==90069])\n",
"# df = {irs['zipcode'], irs['N2']}\n",
"\n"
]
},
{
"cell_type": "code",
2023-04-13 19:45:53 +00:00
"execution_count": 4,
2023-03-03 08:51:14 +00:00
"metadata": {},
"outputs": [
{
2023-04-13 18:37:53 +00:00
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>zip</th>\n",
" <th>population</th>\n",
" <th>income</th>\n",
" <th>overall tax paid</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>count</th>\n",
" <td>166698.000000</td>\n",
" <td>1.666980e+05</td>\n",
" <td>166698.00000</td>\n",
" <td>1.666980e+05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>mean</th>\n",
" <td>48877.636432</td>\n",
" <td>3.432536e+03</td>\n",
" <td>3.50000</td>\n",
" <td>1.844871e+03</td>\n",
" </tr>\n",
" <tr>\n",
" <th>std</th>\n",
" <td>27146.337114</td>\n",
" <td>6.676873e+04</td>\n",
" <td>1.70783</td>\n",
" <td>5.785610e+04</td>\n",
" </tr>\n",
" <tr>\n",
" <th>min</th>\n",
" <td>0.000000</td>\n",
" <td>0.000000e+00</td>\n",
" <td>1.00000</td>\n",
" <td>0.000000e+00</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25%</th>\n",
" <td>27040.000000</td>\n",
" <td>1.400000e+02</td>\n",
" <td>2.00000</td>\n",
" <td>1.600000e+01</td>\n",
" </tr>\n",
" <tr>\n",
" <th>50%</th>\n",
" <td>48879.000000</td>\n",
" <td>5.100000e+02</td>\n",
" <td>3.50000</td>\n",
" <td>1.440000e+02</td>\n",
" </tr>\n",
" <tr>\n",
" <th>75%</th>\n",
" <td>70607.000000</td>\n",
" <td>2.000000e+03</td>\n",
" <td>5.00000</td>\n",
" <td>6.310000e+02</td>\n",
" </tr>\n",
" <tr>\n",
" <th>max</th>\n",
" <td>99999.000000</td>\n",
" <td>9.566490e+06</td>\n",
" <td>6.00000</td>\n",
" <td>1.557123e+07</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" zip population income overall tax paid\n",
"count 166698.000000 1.666980e+05 166698.00000 1.666980e+05\n",
"mean 48877.636432 3.432536e+03 3.50000 1.844871e+03\n",
"std 27146.337114 6.676873e+04 1.70783 5.785610e+04\n",
"min 0.000000 0.000000e+00 1.00000 0.000000e+00\n",
"25% 27040.000000 1.400000e+02 2.00000 1.600000e+01\n",
"50% 48879.000000 5.100000e+02 3.50000 1.440000e+02\n",
"75% 70607.000000 2.000000e+03 5.00000 6.310000e+02\n",
"max 99999.000000 9.566490e+06 6.00000 1.557123e+07"
]
},
2023-04-13 19:45:53 +00:00
"execution_count": 4,
2023-04-13 18:37:53 +00:00
"metadata": {},
"output_type": "execute_result"
2023-03-03 08:51:14 +00:00
}
],
"source": [
"#wrangle tax\n",
"taxdf = pd.DataFrame(zip(irs['zipcode'], irs['N2'], irs['agi_stub'], irs['A11901']))\n",
"taxdf.columns=('zip', 'population', 'income', 'overall tax paid')\n",
2023-04-13 18:37:53 +00:00
"taxdf.describe()"
2023-03-03 08:51:14 +00:00
]
},
{
"cell_type": "code",
2023-04-13 19:45:53 +00:00
"execution_count": 5,
2023-03-03 08:51:14 +00:00
"metadata": {},
"outputs": [
{
2023-04-13 18:37:53 +00:00
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>zip</th>\n",
" <th>gay tax rate</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>count</th>\n",
" <td>2328.000000</td>\n",
" <td>2328.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>mean</th>\n",
" <td>48616.478522</td>\n",
" <td>4103.440722</td>\n",
" </tr>\n",
" <tr>\n",
" <th>std</th>\n",
" <td>35481.240641</td>\n",
" <td>3140.699446</td>\n",
" </tr>\n",
" <tr>\n",
" <th>min</th>\n",
" <td>1730.000000</td>\n",
" <td>0.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25%</th>\n",
" <td>11362.750000</td>\n",
" <td>1767.500000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>50%</th>\n",
" <td>46351.000000</td>\n",
" <td>3635.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>75%</th>\n",
" <td>80234.250000</td>\n",
" <td>5745.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>max</th>\n",
" <td>98686.000000</td>\n",
" <td>24560.000000</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" zip gay tax rate\n",
"count 2328.000000 2328.000000\n",
"mean 48616.478522 4103.440722\n",
"std 35481.240641 3140.699446\n",
"min 1730.000000 0.000000\n",
"25% 11362.750000 1767.500000\n",
"50% 46351.000000 3635.000000\n",
"75% 80234.250000 5745.000000\n",
"max 98686.000000 24560.000000"
]
},
2023-04-13 19:45:53 +00:00
"execution_count": 5,
2023-04-13 18:37:53 +00:00
"metadata": {},
"output_type": "execute_result"
2023-03-03 08:51:14 +00:00
}
],
"source": [
"#wrangle gay\n",
"gaydf = pd.DataFrame(zip(gaybourhoods['GEOID10'], gaybourhoods['Tax_Mjoint']))\n",
"gaydf.columns=(('zip', 'gay tax rate'))\n",
"\n",
2023-04-13 18:37:53 +00:00
"gaydf.describe()"
2023-03-03 08:51:14 +00:00
]
},
{
"cell_type": "code",
2023-04-13 19:45:53 +00:00
"execution_count": 6,
2023-03-03 08:51:14 +00:00
"metadata": {},
"outputs": [
{
2023-04-13 18:37:53 +00:00
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>zip</th>\n",
" <th>population</th>\n",
" <th>gay tax rate</th>\n",
" <th>overall tax paid</th>\n",
" <th>income</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>count</th>\n",
2023-04-13 19:45:53 +00:00
" <td>2184.000000</td>\n",
" <td>2184.000000</td>\n",
" <td>2184.000000</td>\n",
" <td>2184.000000</td>\n",
" <td>2184.0</td>\n",
2023-04-13 18:37:53 +00:00
" </tr>\n",
" <tr>\n",
" <th>mean</th>\n",
2023-04-13 19:45:53 +00:00
" <td>48935.203297</td>\n",
" <td>26691.730769</td>\n",
" <td>4373.997253</td>\n",
" <td>596.719322</td>\n",
" <td>1.0</td>\n",
2023-04-13 18:37:53 +00:00
" </tr>\n",
" <tr>\n",
" <th>std</th>\n",
2023-04-13 19:45:53 +00:00
" <td>35451.335807</td>\n",
" <td>17960.713867</td>\n",
" <td>3054.620840</td>\n",
" <td>615.174358</td>\n",
" <td>0.0</td>\n",
2023-04-13 18:37:53 +00:00
" </tr>\n",
" <tr>\n",
" <th>min</th>\n",
2023-04-13 19:45:53 +00:00
" <td>1730.000000</td>\n",
" <td>160.000000</td>\n",
" <td>0.000000</td>\n",
" <td>0.000000</td>\n",
" <td>1.0</td>\n",
2023-04-13 18:37:53 +00:00
" </tr>\n",
" <tr>\n",
" <th>25%</th>\n",
2023-04-13 19:45:53 +00:00
" <td>11360.750000</td>\n",
" <td>13337.500000</td>\n",
" <td>2110.000000</td>\n",
" <td>217.000000</td>\n",
" <td>1.0</td>\n",
2023-04-13 18:37:53 +00:00
" </tr>\n",
" <tr>\n",
" <th>50%</th>\n",
2023-04-13 19:45:53 +00:00
" <td>60023.500000</td>\n",
" <td>24070.000000</td>\n",
" <td>3900.000000</td>\n",
" <td>434.000000</td>\n",
" <td>1.0</td>\n",
2023-04-13 18:37:53 +00:00
" </tr>\n",
" <tr>\n",
" <th>75%</th>\n",
2023-04-13 19:45:53 +00:00
" <td>80227.250000</td>\n",
" <td>35640.000000</td>\n",
" <td>5902.500000</td>\n",
" <td>777.250000</td>\n",
" <td>1.0</td>\n",
2023-04-13 18:37:53 +00:00
" </tr>\n",
" <tr>\n",
" <th>max</th>\n",
2023-04-13 19:45:53 +00:00
" <td>98686.000000</td>\n",
" <td>114420.000000</td>\n",
" <td>24560.000000</td>\n",
" <td>9166.000000</td>\n",
" <td>1.0</td>\n",
2023-04-13 18:37:53 +00:00
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
2023-04-13 19:45:53 +00:00
" zip population gay tax rate overall tax paid income\n",
"count 2184.000000 2184.000000 2184.000000 2184.000000 2184.0\n",
"mean 48935.203297 26691.730769 4373.997253 596.719322 1.0\n",
"std 35451.335807 17960.713867 3054.620840 615.174358 0.0\n",
"min 1730.000000 160.000000 0.000000 0.000000 1.0\n",
"25% 11360.750000 13337.500000 2110.000000 217.000000 1.0\n",
"50% 60023.500000 24070.000000 3900.000000 434.000000 1.0\n",
"75% 80227.250000 35640.000000 5902.500000 777.250000 1.0\n",
"max 98686.000000 114420.000000 24560.000000 9166.000000 1.0"
2023-04-13 18:37:53 +00:00
]
},
2023-04-13 19:45:53 +00:00
"execution_count": 6,
2023-04-13 18:37:53 +00:00
"metadata": {},
"output_type": "execute_result"
2023-03-03 08:51:14 +00:00
}
],
"source": [
"#merge\n",
"df = pd.merge(taxdf, gaydf)\n",
"\n",
"# print(df)\n",
"\n",
"df2 = df.groupby(df['zip']).aggregate({ 'zip':'first',\n",
" 'population': 'sum',\n",
" 'gay tax rate':'first',\n",
" 'overall tax paid':'first',\n",
" 'income':'first'\n",
" })\n",
"\n",
2023-04-13 18:37:53 +00:00
"df2.to_csv(\"../data/processed/tax_and_gay.csv\")\n",
"df2.describe()"
2023-03-03 09:13:54 +00:00
]
},
{
"cell_type": "code",
2023-04-13 19:45:53 +00:00
"execution_count": 7,
2023-03-07 08:41:48 +00:00
"metadata": {},
2023-04-13 18:37:53 +00:00
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>zip</th>\n",
" <th>population</th>\n",
" <th>gay tax rate</th>\n",
" <th>overall tax paid</th>\n",
" <th>income</th>\n",
" </tr>\n",
" <tr>\n",
" <th>zip</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>1730</th>\n",
" <td>1730</td>\n",
" <td>13570.0</td>\n",
" <td>3260</td>\n",
" <td>150.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1731</th>\n",
" <td>1731</td>\n",
" <td>2450.0</td>\n",
" <td>550</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1742</th>\n",
" <td>1742</td>\n",
" <td>17170.0</td>\n",
" <td>4220</td>\n",
" <td>297.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1760</th>\n",
" <td>1760</td>\n",
" <td>34350.0</td>\n",
" <td>7880</td>\n",
" <td>468.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1770</th>\n",
" <td>1770</td>\n",
" <td>4310.0</td>\n",
" <td>1060</td>\n",
" <td>46.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>98682</th>\n",
" <td>98682</td>\n",
" <td>57010.0</td>\n",
" <td>11080</td>\n",
" <td>703.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>98683</th>\n",
" <td>98683</td>\n",
" <td>30700.0</td>\n",
" <td>6470</td>\n",
" <td>358.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>98684</th>\n",
" <td>98684</td>\n",
" <td>27630.0</td>\n",
" <td>5390</td>\n",
" <td>371.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>98685</th>\n",
" <td>98685</td>\n",
" <td>27540.0</td>\n",
" <td>6490</td>\n",
" <td>298.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>98686</th>\n",
" <td>98686</td>\n",
" <td>17800.0</td>\n",
" <td>4120</td>\n",
" <td>215.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>2184 rows × 5 columns</p>\n",
"</div>"
],
"text/plain": [
" zip population gay tax rate overall tax paid income\n",
"zip \n",
"1730 1730 13570.0 3260 150.0 1\n",
"1731 1731 2450.0 550 0.0 1\n",
"1742 1742 17170.0 4220 297.0 1\n",
"1760 1760 34350.0 7880 468.0 1\n",
"1770 1770 4310.0 1060 46.0 1\n",
"... ... ... ... ... ...\n",
"98682 98682 57010.0 11080 703.0 1\n",
"98683 98683 30700.0 6470 358.0 1\n",
"98684 98684 27630.0 5390 371.0 1\n",
"98685 98685 27540.0 6490 298.0 1\n",
"98686 98686 17800.0 4120 215.0 1\n",
"\n",
"[2184 rows x 5 columns]"
]
},
2023-04-13 19:45:53 +00:00
"execution_count": 7,
2023-04-13 18:37:53 +00:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df2"
]
2023-03-07 08:41:48 +00:00
},
{
"cell_type": "code",
2023-04-13 19:45:53 +00:00
"execution_count": 8,
2023-03-03 09:13:54 +00:00
"metadata": {},
"outputs": [
{
2023-04-13 18:37:53 +00:00
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>zip</th>\n",
" <th>population</th>\n",
" <th>gay tax rate</th>\n",
" <th>overall tax paid</th>\n",
" <th>income</th>\n",
" <th>lat</th>\n",
" <th>long</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>count</th>\n",
" <td>2184.000000</td>\n",
" <td>2184.000000</td>\n",
" <td>2184.000000</td>\n",
" <td>2184.000000</td>\n",
" <td>2184.0</td>\n",
" <td>2184.000000</td>\n",
" <td>2184.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>mean</th>\n",
" <td>48935.203297</td>\n",
" <td>26691.730769</td>\n",
" <td>4373.997253</td>\n",
" <td>596.719322</td>\n",
" <td>1.0</td>\n",
" <td>38.016518</td>\n",
" <td>-91.296804</td>\n",
" </tr>\n",
" <tr>\n",
" <th>std</th>\n",
" <td>35451.335807</td>\n",
" <td>17960.713867</td>\n",
" <td>3054.620840</td>\n",
" <td>615.174358</td>\n",
" <td>0.0</td>\n",
" <td>5.210272</td>\n",
" <td>18.476699</td>\n",
" </tr>\n",
" <tr>\n",
" <th>min</th>\n",
" <td>1730.000000</td>\n",
" <td>160.000000</td>\n",
" <td>0.000000</td>\n",
" <td>0.000000</td>\n",
" <td>1.0</td>\n",
" <td>25.572213</td>\n",
" <td>-123.118977</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25%</th>\n",
" <td>11360.750000</td>\n",
" <td>13337.500000</td>\n",
" <td>2110.000000</td>\n",
" <td>217.000000</td>\n",
" <td>1.0</td>\n",
" <td>33.997027</td>\n",
" <td>-105.037767</td>\n",
" </tr>\n",
" <tr>\n",
" <th>50%</th>\n",
" <td>60023.500000</td>\n",
" <td>24070.000000</td>\n",
" <td>3900.000000</td>\n",
" <td>434.000000</td>\n",
" <td>1.0</td>\n",
" <td>39.930150</td>\n",
" <td>-87.603617</td>\n",
" </tr>\n",
" <tr>\n",
" <th>75%</th>\n",
" <td>80227.250000</td>\n",
" <td>35640.000000</td>\n",
" <td>5902.500000</td>\n",
" <td>777.250000</td>\n",
" <td>1.0</td>\n",
" <td>40.960828</td>\n",
" <td>-74.310179</td>\n",
" </tr>\n",
" <tr>\n",
" <th>max</th>\n",
" <td>98686.000000</td>\n",
" <td>114420.000000</td>\n",
" <td>24560.000000</td>\n",
" <td>9166.000000</td>\n",
" <td>1.0</td>\n",
" <td>47.916786</td>\n",
" <td>-70.758184</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" zip population gay tax rate overall tax paid income \\\n",
"count 2184.000000 2184.000000 2184.000000 2184.000000 2184.0 \n",
"mean 48935.203297 26691.730769 4373.997253 596.719322 1.0 \n",
"std 35451.335807 17960.713867 3054.620840 615.174358 0.0 \n",
"min 1730.000000 160.000000 0.000000 0.000000 1.0 \n",
"25% 11360.750000 13337.500000 2110.000000 217.000000 1.0 \n",
"50% 60023.500000 24070.000000 3900.000000 434.000000 1.0 \n",
"75% 80227.250000 35640.000000 5902.500000 777.250000 1.0 \n",
"max 98686.000000 114420.000000 24560.000000 9166.000000 1.0 \n",
"\n",
" lat long \n",
"count 2184.000000 2184.000000 \n",
"mean 38.016518 -91.296804 \n",
"std 5.210272 18.476699 \n",
"min 25.572213 -123.118977 \n",
"25% 33.997027 -105.037767 \n",
"50% 39.930150 -87.603617 \n",
"75% 40.960828 -74.310179 \n",
"max 47.916786 -70.758184 "
]
},
2023-04-13 19:45:53 +00:00
"execution_count": 8,
2023-04-13 18:37:53 +00:00
"metadata": {},
"output_type": "execute_result"
2023-03-03 09:13:54 +00:00
}
],
"source": [
"## take the dataset & add long/lat\n",
"## props to Nat for creating the backbone I used to zipcode -> long/lat\n",
"\n",
"cords = pd.read_csv(\"../data/raw/zip_lat_long.csv\")\n",
"gaydf = pd.read_csv(\"../data/processed/tax_and_gay.csv\")\n",
"\n",
"# Let's add long/lat columns to gb\n",
"gaydf = gaydf.merge(cords, left_on=\"zip\", right_on=\"ZIP\")\n",
"\n",
"# // unneded was already filtered out\n",
"\n",
"# There's a lot of info baked into some of these columns. Especially the composite indexes.\n",
"# We'll leave their names as is for easy reference even if they're a little ugly.\n",
"gaydf = gaydf.rename({\n",
" \"LAT\": \"lat\",\n",
" \"LNG\": \"long\",\n",
"}, axis=\"columns\")\n",
"\n",
"# gb.to_csv(\"../data/processed/gaybourhoods-nat.csv\")\n",
"# gb.head()\n",
"\n",
"# unperson unneccesary zip codes\n",
"del gaydf['zip.1']\n",
"del gaydf['ZIP']\n",
"\n",
2023-04-13 18:37:53 +00:00
"gaydf.describe()"
]
},
{
"cell_type": "code",
2023-04-13 19:45:53 +00:00
"execution_count": 9,
2023-04-13 18:37:53 +00:00
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
2023-04-13 19:45:53 +00:00
" <th>zip</th>\n",
" <th>population</th>\n",
" <th>gay tax rate</th>\n",
" <th>overall tax paid</th>\n",
" <th>income</th>\n",
2023-04-13 18:37:53 +00:00
" <th>lat</th>\n",
" <th>long</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
2023-04-13 19:45:53 +00:00
" <td>1730</td>\n",
" <td>13570.0</td>\n",
" <td>3260</td>\n",
" <td>150.0</td>\n",
2023-04-13 18:37:53 +00:00
" <td>1</td>\n",
2023-04-13 19:45:53 +00:00
" <td>42.499295</td>\n",
" <td>-71.281889</td>\n",
2023-04-13 18:37:53 +00:00
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
2023-04-13 19:45:53 +00:00
" <td>1731</td>\n",
" <td>2450.0</td>\n",
" <td>550</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" <td>42.456748</td>\n",
" <td>-71.279484</td>\n",
2023-04-13 18:37:53 +00:00
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
2023-04-13 19:45:53 +00:00
" <td>1742</td>\n",
" <td>17170.0</td>\n",
" <td>4220</td>\n",
" <td>297.0</td>\n",
2023-04-13 18:37:53 +00:00
" <td>1</td>\n",
2023-04-13 19:45:53 +00:00
" <td>42.462911</td>\n",
" <td>-71.364496</td>\n",
2023-04-13 18:37:53 +00:00
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
2023-04-13 19:45:53 +00:00
" <td>1760</td>\n",
" <td>34350.0</td>\n",
" <td>7880</td>\n",
" <td>468.0</td>\n",
2023-04-13 18:37:53 +00:00
" <td>1</td>\n",
2023-04-13 19:45:53 +00:00
" <td>42.284822</td>\n",
" <td>-71.348811</td>\n",
2023-04-13 18:37:53 +00:00
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
2023-04-13 19:45:53 +00:00
" <td>1770</td>\n",
" <td>4310.0</td>\n",
" <td>1060</td>\n",
" <td>46.0</td>\n",
2023-04-13 18:37:53 +00:00
" <td>1</td>\n",
2023-04-13 19:45:53 +00:00
" <td>42.231947</td>\n",
" <td>-71.372963</td>\n",
2023-04-13 18:37:53 +00:00
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
2023-04-13 19:45:53 +00:00
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
2023-04-13 18:37:53 +00:00
" </tr>\n",
" <tr>\n",
2023-04-13 19:45:53 +00:00
" <th>2179</th>\n",
" <td>98682</td>\n",
" <td>57010.0</td>\n",
" <td>11080</td>\n",
" <td>703.0</td>\n",
" <td>1</td>\n",
" <td>45.673209</td>\n",
" <td>-122.481745</td>\n",
2023-04-13 18:37:53 +00:00
" </tr>\n",
" <tr>\n",
2023-04-13 19:45:53 +00:00
" <th>2180</th>\n",
" <td>98683</td>\n",
" <td>30700.0</td>\n",
" <td>6470</td>\n",
" <td>358.0</td>\n",
" <td>1</td>\n",
" <td>45.603287</td>\n",
" <td>-122.510170</td>\n",
2023-04-13 18:37:53 +00:00
" </tr>\n",
" <tr>\n",
2023-04-13 19:45:53 +00:00
" <th>2181</th>\n",
" <td>98684</td>\n",
" <td>27630.0</td>\n",
" <td>5390</td>\n",
" <td>371.0</td>\n",
" <td>1</td>\n",
" <td>45.630556</td>\n",
" <td>-122.514839</td>\n",
2023-04-13 18:37:53 +00:00
" </tr>\n",
" <tr>\n",
2023-04-13 19:45:53 +00:00
" <th>2182</th>\n",
" <td>98685</td>\n",
" <td>27540.0</td>\n",
" <td>6490</td>\n",
" <td>298.0</td>\n",
" <td>1</td>\n",
" <td>45.715211</td>\n",
" <td>-122.693165</td>\n",
2023-04-13 18:37:53 +00:00
" </tr>\n",
" <tr>\n",
2023-04-13 19:45:53 +00:00
" <th>2183</th>\n",
" <td>98686</td>\n",
" <td>17800.0</td>\n",
" <td>4120</td>\n",
" <td>215.0</td>\n",
" <td>1</td>\n",
" <td>45.723392</td>\n",
" <td>-122.624397</td>\n",
2023-04-13 18:37:53 +00:00
" </tr>\n",
" </tbody>\n",
"</table>\n",
2023-04-13 19:45:53 +00:00
"<p>2184 rows × 7 columns</p>\n",
2023-04-13 18:37:53 +00:00
"</div>"
],
"text/plain": [
2023-04-13 19:45:53 +00:00
" zip population gay tax rate overall tax paid income lat \\\n",
"0 1730 13570.0 3260 150.0 1 42.499295 \n",
"1 1731 2450.0 550 0.0 1 42.456748 \n",
"2 1742 17170.0 4220 297.0 1 42.462911 \n",
"3 1760 34350.0 7880 468.0 1 42.284822 \n",
"4 1770 4310.0 1060 46.0 1 42.231947 \n",
"... ... ... ... ... ... ... \n",
"2179 98682 57010.0 11080 703.0 1 45.673209 \n",
"2180 98683 30700.0 6470 358.0 1 45.603287 \n",
"2181 98684 27630.0 5390 371.0 1 45.630556 \n",
"2182 98685 27540.0 6490 298.0 1 45.715211 \n",
"2183 98686 17800.0 4120 215.0 1 45.723392 \n",
2023-04-13 18:37:53 +00:00
"\n",
2023-04-13 19:45:53 +00:00
" long \n",
"0 -71.281889 \n",
"1 -71.279484 \n",
"2 -71.364496 \n",
"3 -71.348811 \n",
"4 -71.372963 \n",
"... ... \n",
"2179 -122.481745 \n",
"2180 -122.510170 \n",
"2181 -122.514839 \n",
"2182 -122.693165 \n",
"2183 -122.624397 \n",
"\n",
"[2184 rows x 7 columns]"
2023-04-13 18:37:53 +00:00
]
},
2023-04-13 19:45:53 +00:00
"execution_count": 9,
2023-04-13 18:37:53 +00:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"gaydf"
2023-03-02 00:10:26 +00:00
]
},
2023-03-07 08:41:48 +00:00
{
"cell_type": "code",
2023-04-13 19:45:53 +00:00
"execution_count": 10,
2023-03-07 08:41:48 +00:00
"metadata": {},
"outputs": [
{
"data": {
2023-04-13 18:37:53 +00:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjIAAAHHCAYAAACle7JuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/P9b71AAAACXBIWXMAAA9hAAAPYQGoP6dpAABOTklEQVR4nO3deXxU9b3/8deZfSbJTDYCiQSMJMquuCNEUVEqSkVtbyu9VcFW7XWptrVKtSqoxdbb1laqV1tF+2ux2622WqvXXUBqKbIjSBBJkCUkJDOZzD5zfn8gUyM7JJmc8H4+Hnk8nHPOnHzm62Tmzfd8v99jmKZpIiIiImJBtlwXICIiInKoFGRERETEshRkRERExLIUZERERMSyFGRERETEshRkRERExLIUZERERMSyFGRERETEshRkRERExLIUZETE8j766CMMw+Cpp57KdSki0s0UZESk27zzzjvcc889tLa25rqUrJ5Yk4gcOAUZEek277zzDjNmzOhRoaEn1iQiB05BRkRERCxLQUZEusU999zDrbfeCkBVVRWGYWAYBh999NFenzNu3DiGDx/O4sWLOeOMM/B6vVRVVfE///M/B/Q7X3/9dWpra8nLy6OwsJCLL76Y999//7BqEpGexZHrAkTkyHDppZfywQcf8Mwzz/DTn/6U0tJSAPr06bPP57W0tDBx4kT+4z/+g8svv5w//OEPfOMb38DlcjFt2rS9Pu/VV1/lggsu4JhjjuGee+4hGo3y8MMPM2bMGN577z2OPvroQ65JRHoQU0Skmzz44IMmYG7YsOGAjj/rrLNMwPzxj3+c3RaPx80TTjjBLCsrMxOJhGmaprlhwwYTMOfMmZM9btcxzc3N2W3Lli0zbTabecUVVxxyTSLSs+jSkoj0aA6Hg2uvvTb72OVyce2119LY2MjixYv3+JwtW7awdOlSrrrqKoqLi7PbR44cyXnnnceLL77Y5XWLSPdQkBGRHq2iooK8vLwO24499liAvY5l2bhxIwDHHXfcb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PsmDyecTBKM2NUzIyIi0gXUI3OQPm6JMP3PyxlcEcBhM1iztY2H36jrEGIA5q1r4s5nV+C22QlHkzmqVkREpHdTkDkIwUiCjc0RFtQ1c+KAIjAMyvye3ULMLvPqmtnUEuXjUIxNOyLdXK2IiEjvpyBzEJrCCYKxnb0rTrtBWzRFPJXZ53Nao0ny3U6mP7uCYCTRHWWKiIgcMRRkDkIolqRPvhuA4jwXPpcdt2PfTeh22AjHU8xb10RjW7w7yhQRETliKMgcBL/Hictho7a6FLth4HXZ2RaKMaa6ZI/H11aXsKShlTyXHYCgxsqIiIh0KgWZg1Ca72JHOMGMi4dhYuK0GVT3yePGc2p2CzO11aVMHVvF6s1BHHYDgEQqo8tLIiIinUjTrw9CwOeivNBDWyxJgcdJJJmin99LU3uMmZ8fTiSZoj2exmEzmF/XxG/+sZFragfx6vvbqK0p5Z0Pm+nr92gqtoiISCdRj8xB6uf3EE2kSaYzeBwOmttjeJ0O7DZY+XGI9niKxrY4I44KcN6QvsRTaZbUt3LPpGE8OX8DbTFdXhIREeksPSbIPPDAAxiGwc0335zdNm7cOAzD6PBz3XXX5a5IdvbK9C/yYbJzTRmf28kFP5/PxJ/P5+PWKIZhkO9xUOZ3M7jcT5nfw3fOP46XVm0hkkhT4HHmtH4REZHepEdcWlq0aBGPPfYYI0eO3G3f17/+dWbOnJl97PP5urO0Pepf7KOhuZ3/fucjrhozkNqaUuata2L263UdjqutLuW+S4ZT3xzhF2+s58yaUkrzdVlJRESks+S8RyYcDvOVr3yFX/7ylxQVFe223+fz0a9fv+yP3+/PQZW7swF3TBzCU/M/Yuq
2023-03-07 08:41:48 +00:00
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"\n",
"#compare taxes paid by queers to taxes paid by general\n",
"\n",
"plot1 = sns.scatterplot(data=gaydf, x=\"long\", y=\"lat\")\n",
"_ = plot1.set(xlabel=\"Long\", ylabel=\"Lat\", title=\"t plot\")"
]
},
2023-02-16 00:29:26 +00:00
{
2023-04-13 18:37:53 +00:00
"cell_type": "markdown",
2023-02-16 00:29:26 +00:00
"metadata": {},
2023-03-03 08:51:14 +00:00
"source": [
2023-04-13 18:37:53 +00:00
"The next step is to compare the gay data to the typical data, so the following models are used to compare the taxes each group paid"
2023-03-07 08:41:48 +00:00
]
},
{
"cell_type": "code",
2023-04-13 19:45:53 +00:00
"execution_count": 11,
2023-03-07 08:41:48 +00:00
"metadata": {},
"outputs": [
{
"data": {
2023-04-13 18:37:53 +00:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjIAAAHHCAYAAACle7JuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/P9b71AAAACXBIWXMAAA9hAAAPYQGoP6dpAACDWElEQVR4nOzdeXwU9f348dfM7JlNNvcJIZxyH4qK8cADNFW0Wi88WlFRWov3bbWKtlarrVetVu1P0VarYqv1RBEPrKACcsslhDsXkHPvnfn8/ojZr0sSCJCwSXg/H499PLIzn/3Meyab3Xc+8zk0pZRCCCGEEKIL0hMdgBBCCCHEvpJERgghhBBdliQyQgghhOiyJJERQgghRJcliYwQQgghuixJZIQQQgjRZUkiI4QQQoguSxIZIYQQQnRZksgIIYQQosuSREaIXUybNg1N09pUVtM0pk2bttsyn332GZqm8cYbb7RDdEK07tJLL6V3795tKrs37/P2sjfx7a/evXtz+umnH5BjicSSROYgo2lamx6fffZZokMV++jLL7/kZz/7Gbm5uTidTnr37s2vfvUrNm/enOjQxAHm9/uZNm1at/17/u6775g2bRobNmxIWAy7S5gWLFiApmlMnz49bvv//vc/Tj31VHr06IHL5aJXr16cccYZvPLKKwcg4u7HlugAxIH1j3/8I+75Sy+9xKxZs5ptHzx48IEMq1O56667uP322xMdxj75y1/+wnXXXUffvn255ppryM/PZ+XKlfz973/ntdde44MPPuCoo45KdJiigzz33HNYlhV77vf7uffeewE44YQT4som4n2+a3z767vvvuPee+/lhBNOOGAtPftrxowZTJw4kVGjRnHdddeRnp5OaWkpc+bM4bnnnuOiiy5KdIhdjiQyB5mf//zncc+/+uorZs2a1Wz7wcxms2Gzdb0/jS+//JLrr7+eY489lpkzZ5KUlBTbd9VVV3HMMcdwzjnnsGLFCtLS0hIX6G74fD48Hk+iw+iy7HZ7m8sm4n2+N/F1V9OmTWPIkCF89dVXOByOuH2VlZUJiqprk1tLopkXXniBk046iZycHJxOJ0OGDOHpp5+OK/PJJ5+g6zp333133PZXXnkFTdPiym/dupXLL788dqtj6NChPP/8882O+5e//IWhQ4eSlJREeno6hx9++B6bWpv6n7z22mv85je/IS8vD4/Hw09/+tNmt1K++OILzjvvPHr16oXT6aSwsJAbbriBQCAQV66lvgOhUIgbbriB7OxsUlJS+OlPf8qWLVt2G9uuTNPcbYz33HMPdrudqqqqZq+dMmUKaWlpBIPBVuv/3e9+h6ZpvPjii3FJDEC/fv146KGH2LZtG88++2xs+wknnNDsP3VouS+DZVk89thjDB06FJfLRW5uLr/85S+prq5u9voPPviA4447Do/HQ0pKChMmTGDFihXNjpGcnMy6des47bTTSElJ4eKLL271/KDxvTR58mQKCgpwOp306dOHq666inA4HCuzfv16zjvvPDIyMkhKSuKoo47ivffei6un6X3z+uuvc++999KjRw9SUlI499xzqa2tJRQKcf3115OTk0NycjKXXXYZoVAorg5N07j66quZMWMGQ4YMwe12U1xczLJlywB45pln6N+/Py6XixNOOKHZ7Y/evXtz6aWXNjvHXX8nP471/vvvp2fPnrhcLsaNG8f333/f7Jo2/d42bNhAdnY2APfee2/stnFTn67W+sj885//ZPTo0bjdbjIyMrjgggua/S2tXbuWc845h7y8PFwuFz179uSCCy6gtra2WX2txdcUo6Zp/OlPf+LZZ5+lX79+OJ1OjjjiCObPn7/buqZPn855550HwIknntjqbfH//e9/HHnkkbhcLvr27ctLL73UrK6amhquv/56CgsLcTqd9O/fnz/+8Y/t2nrUZN26dRxxxBHNkhiAnJycdj/ewaDr/dspOtzTTz/N0KFD+elPf4rNZuOdd97h17/+NZZlMXXqVABOOukkfv3rX/PAAw9w1llncdhhh1FWVsY111zD+PHj+dWvfgVARUUFRx11VOxDPzs7mw8++IDJkydTV1fH9ddfDzQ2OV977bWce+65XHfddQSDQZYuXcrXX3/dpqbW+++/H03TuO2226isrOSxxx5j/PjxLF68GLfbDTQ26fr9fq666ioyMzP55ptv+Mtf/sKWLVuYMWPGbuu/4oor+Oc//8lFF13E0UcfzSeffMKECRP26rruKcZf/OIX3Hfffbz22mtcffXVsdeFw2HeeOMNzjnnHFwuV4t1+/1+Zs+ezXHHHUefPn1aLDNx4kSmTJnCO++8w6233rpXsQP88pe/ZPr06Vx22WVce+21lJaW8uSTT7Jo0SK+/PLL2H/b//jHP5g0aRIlJSX88Y9/xO/38/TTT3PssceyaNGiuC+yaDRKSUkJxx57LH/605+aJWA/tm3bNo488khqamqYMmUKgwYNYuvWrbzxxhv4/X4cDgcVFRUcffTR+P1+rr32WjIzM3nxxRf56U9/yhtvvMHPfvazuDofeOAB3G43t99+O99//z1/+ctfsNvt6LpOdXU106ZN46uvvmL69On06dOnWeL+xRdf8Pbbb8f+Lh544AFOP/10br31Vp566il+/etfU11dzUMPPcTll1/OJ598stfXvcmDDz6IruvcfPPN1NbW8tBDD3HxxRfz9ddft1g+Ozubp59+mquuuoqf/exnnH322QCMGDGi1WPcf//9/Pa3v+X888/niiuuoKqqir/85S+MHTuWRYsWkZaWRjgcpqSkhFAoxDXXXENeXh5bt27l3XffpaamhtTU1L0+t1deeYX6+np++ctfomkaDz30EGeffTbr169vtRVn7NixXHvttTzxxBP85je/id0O//Ft8e+//55zzz2XyZMnM2nSJJ5//nkuvfRSRo8ezdChQ4HGv53jjz+erVu38stf/pJevXoxd+5c7rjjDsrKynjsscf2+nx2p6ioiNmzZ7NlyxZ69uzZrnUftJQ4qE2dOlXt+jbw+/3NypWUlKi+ffvGbfP5fKp///5q6NChKhgMqgkTJiiv16s2btwYKzN58mSVn5+vtm/fHvfaCy64QKWmpsaOdeaZZ6qhQ4fudfyffvqpAlSPHj1UXV1dbPvrr7+uAPX444/v9rweeOABpWlaXMz33HNP3DVZvHixAtSvf/3ruNdedNFFClD33HNPu8VYXFysxowZE/f6//znPwpQn376aavHaIrxuuuu220sI0aMUBkZGbHnxx9/vDr++OOblZs0aZIqKiqKPf/iiy8UoF5++eW4cjNnzozbXl9fr9LS0tSVV14ZV668vFylpqbGbZ80aZIC1O23377bmJtccsklStd1NX/+/Gb7LMtSSil1/fXXK0B98cUXsX319fWqT58+qnfv3so0TaXU//1Ohg0bpsLhcKzshRdeqDRNU6eeempc/cXFxXHXQymlAOV0OlVpaWls2zPPPKMAlZeXF/e7vuOOOxQQV7aoqEhNmjSp2bns+jtpinXw4MEqFArFtj/++OMKUMuWLYtt2/X3VlVV1ep7dNf3+YYNG5RhGOr++++PK7ds2TJls9li2xctWqQANWPGjGZ17smu8ZWWlipAZWZmqp07d8a2//e//1WAeuedd3Zb34wZM1r92ygqKlKAmjNnTmxbZWWlcjqd6qabbopt+93vfqc8Ho9as2ZN3Otvv/12ZRiG2rRp025jKCoqUhMmTGhx3/z58xWgXnjhhdi2//f//p8ClMPhUCeeeKL67W9/q7744ovYe1PsPbm1JJppasEAqK2tZfv27Rx//PGsX78+ruk4KSmJ6dOns3LlSsaOHct7773Ho48+Sq9evQBQSvHvf/+bM844A6UU27dvjz1KSkqora3l22+/BSAtLY0tW7bssTm5NZdccgkpKSmx5+eeey75+fm8//77LZ6Xz+dj+/btHH300SilWLRoUat1N9Vx7bXXxm1vak1qzxgvueQSvv76a9atWxfb9vLLL1NYWMjxxx/fat319fUAcfW3JCUlJVZ2b8yYMYPU1FROPvnkuN/
2023-03-07 08:41:48 +00:00
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"\n",
"gaydfgaytaxplot = gaydf.copy()\n",
"\n",
"# gaydf.head()\n",
"\n",
"del gaydfgaytaxplot['zip']\n",
"del gaydfgaytaxplot['population']\n",
"del gaydfgaytaxplot['overall tax paid']\n",
"del gaydfgaytaxplot['income']\n",
"# del gaydfgaytaxplot['gay tax rate']\n",
"\n",
"plot2 = sns.scatterplot(data=gaydfgaytaxplot, x=\"long\", y=\"lat\", hue='gay tax rate')\n",
2023-04-13 18:37:53 +00:00
"_ = plot2.set(xlabel=\"Longitude\", ylabel=\"Latitude\", title=\"Taxes paid by Queer communities in the US\")\n"
2023-03-07 08:41:48 +00:00
]
},
{
"cell_type": "code",
2023-04-13 19:45:53 +00:00
"execution_count": 12,
2023-03-07 08:41:48 +00:00
"metadata": {},
"outputs": [
{
"data": {
2023-04-13 18:37:53 +00:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjIAAAHHCAYAAACle7JuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/P9b71AAAACXBIWXMAAA9hAAAPYQGoP6dpAAB9+klEQVR4nOzdd5wU9f348dfMbL+7vV44ODrSEcWGvSCoaCwkPwsqGNRosIBR0WhEjcZu0BixxJrAVxNLEhsEC2gUEZHeRHq5AhxX9m7rzOf3x3ob1ruDA/bY2+P9fDzu8bj7zGdn3jPb3veZT9GUUgohhBBCiBSkJzsAIYQQQoj9JYmMEEIIIVKWJDJCCCGESFmSyAghhBAiZUkiI4QQQoiUJYmMEEIIIVKWJDJCCCGESFmSyAghhBAiZUkiI4QQQoiUJYmMEMC9996LpmktqqtpGvfee+8e68yePRtN03jrrbcSEF3bMHbsWLp27dpq+z/11FM59dRTW23/h4oNGzagaRqvvvpqi+q35PWcSPsa34F49dVX0TSNb7/9ttWPJZJHEplDgKZpLfqZPXt2skMV++jDDz88qF9CIjW199fJs88+e1ASo+bsLWE699xzG/0T4PP5mDx5MgMGDCAtLY3c3FwGDx7MzTffzLZt2w5C1O2HLdkBiNb317/+Ne7v119/nVmzZjUq79u378EMq025++67ueOOO5Idxj778MMP+fOf/3xQ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3PDDTfw1FNP0bNnT8aNG8eUKVNi+3vxxRe56aab6NevH1OmTOG+++5j8ODBzJs3r0UxP/jgg3zwwQdMmjSJm266iVmzZjFs2LC4JOUf//gH9fX1XH/99fzpT39ixIgR/OlPf+LKK6/c6/6vvvpqpkyZwvDhw3n44Yex2+2MHDmyRbG1NMYrrriCSCTCm2++Gfe4UCjEW2+9xahRo5r97/VXv/oVZ555JhC9fdjwo2kal19+OR999BGVlZVxj3nvvfeoqalp1BrXkmvZlHHjxjFhwgRKSkp45JFHuOOOO3C5XHz99dexOi15be2L++67jyuuuAK73c7999/PfffdR0lJCZ9++mmszr333sv48eMpLi7miSeeYNSoUTz//PMMHz6ccDgct79du3Zx7rnncuyxx/Loo4/idDq55JJLePPNN7nkkks455xzePjhh6mrq+PnP/85tbW1jWK6+OKLsSyLhx9+mGOPPZYHHniAKVOmcOaZZ9KxY0ceeeQRevbsya233srnn3++X+fdEOtZZ53F4YcfzhNPPEGfPn2YNGkSH330UbOPae510pyD9f79KdM0GTFiBLm5uTz++OOccsopPPHEE7zwwgt7fNyUKVPo1KkTffr0iZ3bXXfdFVfnxhtvZPHixUyePJnrr7+e9957jxtuuCGuzl//+ldGjhxJeno6jzzyCL/73e9YsWIFJ554YqNE80B16dIFiN7mV0oldN+HJCUOOePHj1c/ferr6+sb1RsxYoTq3r17XFldXZ3q2bOn6t+/vwoEAmrkyJHK6/WqjRs3xuqMGzdOdejQQe3YsSPusZdcconKzMyMHev8889X/fv33+f4P/vsMwWojh07qpqamlj53//+dwWop556ao/n9dBDDylN0+Jinjx5ctw1WbRokQLUr3/967jHXnbZZQpQkydPTliMQ4cOVccee2zc49955x0FqM8++2yPx2nquVRKqdWrVytATZ06Na78Zz/7meratauyLGuf4xwzZozq0qVL7O9PP/1UAeqmm25qdPyG/SvV8tfWKaecok455ZQ9nu+aNWuUruvqwgsvVKZpNnnMiooK5XA41PDhw+PqPPPMMwpQL7/8ctwxATV9+vRY2apVqxSgdF1XX3/9dax85syZClCvvPJKrKzhdXPttdfGyiKRiOrUqZPSNE09/PDDsfJdu3Ypt9utxowZEyt75ZVXFKDWr18fdy4Nz8vuz39DrK+//nqsLBgMqqKiIjVq1KhY2fr16xvF2dzrRCnV6PXc2u/fpuIbM2aMAtT9998fV/eII45QQ4YM2es++/fv3+Rrp+H6Dhs2LO41OXHiRGUYhqqqqlJKKVVbW6uysrLUNddcE/f4srIylZmZ2ai8uePMnz+/ye0jR46Me+/U19er3r17K0B16dJFjR07Vr300kuqvLx8r+cqGpMWGQGA2+2O/V5dXc2OHTs45ZRTWLduHdXV1bFtHo+HV199lZUrV3LyySfzwQcf8Mc//pHOnTsDoJTi7bff5rzzzkMpxY4dO2I/I0aMoLq6Otaak5WVxZYtW5g/f/5+xXzllVeSkZER+/vnP/85HTp04MMPP2zyvOrq6tixYwfHH388SikWLlzY7L4b9nHTTTfFlU+YMCHhMV555ZXMmzcv1twMMG3aNEpKSjjllFP26XgNDjvsMI499limTZsWK6usrOSjjz5i9OjRjW6jtSTOn3r77bfRNI3Jkyc32rb7/lv62mqJf/7zn1iWxT333IOux398NRzz448/JhQKMWHChLg611xzDV6vlw8++CDucenp6VxyySWxv3v37k1WVhZ9+/bl2GOPjZU3/L5u3bpGcV199dWx3w3D4KijjkIpxbhx42LlWVlZ9O7du8nHt1R6enpca5rD4eCYY445oH3u7mC+f5vS0Krb4KSTTkrIuV177bVxr8mTTjoJ0zTZuHEjALNmzaKqqopLL7007pwNw+DYY4/ls88+O+AYdud2u5k3bx633XYbEL3FOG7cODp06MCNN95IMBhM6PHaO0lkBABffvklw4YNIy0tjaysLPLz8/ntb38L0OjL5oQTTuD666/nm2++YcSIEfzyl7+Mbdu+fTtVVVW88MIL5Ofnx/1cddVVAFRUVAAwadIk0tPTOeaYY+jVqxfjx4/nyy+/bHHMvXr1ivtb0zR69uwZ1wy8adMmxo4dS05OTuy+e0NysKcv0Y0bN6LrOj169Igr7927d4vja2mMF198MU6
2023-03-07 08:41:48 +00:00
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"gaydfgentaxplot = gaydf.copy()\n",
"\n",
"# gaydf.head()\n",
"\n",
"del gaydfgentaxplot['zip']\n",
"del gaydfgentaxplot['population']\n",
"# del gaydfgentaxplot['overall tax paid']\n",
"del gaydfgentaxplot['income']\n",
"# del gaydfgaytaxplot['gay tax rate']\n",
"\n",
"plot2 = sns.scatterplot(data=gaydfgentaxplot, x=\"long\", y=\"lat\", hue='overall tax paid')\n",
2023-04-13 18:37:53 +00:00
"_ = plot2.set(xlabel=\"Longitude\", ylabel=\"Latitude\", title=\"Taxes paid by typical communities in the US\")"
2023-03-07 08:41:48 +00:00
]
},
{
"cell_type": "code",
2023-04-13 19:45:53 +00:00
"execution_count": 13,
2023-03-07 08:41:48 +00:00
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>gay tax rate</th>\n",
" <th>overall tax paid</th>\n",
" <th>lat</th>\n",
" <th>long</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>count</th>\n",
" <td>2184.000000</td>\n",
" <td>2184.000000</td>\n",
" <td>2184.000000</td>\n",
" <td>2184.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>mean</th>\n",
" <td>4373.997253</td>\n",
" <td>596.719322</td>\n",
" <td>38.016518</td>\n",
" <td>-91.296804</td>\n",
" </tr>\n",
" <tr>\n",
" <th>std</th>\n",
" <td>3054.620840</td>\n",
" <td>615.174358</td>\n",
" <td>5.210272</td>\n",
" <td>18.476699</td>\n",
" </tr>\n",
" <tr>\n",
" <th>min</th>\n",
" <td>0.000000</td>\n",
" <td>0.000000</td>\n",
" <td>25.572213</td>\n",
" <td>-123.118977</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25%</th>\n",
" <td>2110.000000</td>\n",
" <td>217.000000</td>\n",
" <td>33.997027</td>\n",
" <td>-105.037767</td>\n",
" </tr>\n",
" <tr>\n",
" <th>50%</th>\n",
" <td>3900.000000</td>\n",
" <td>434.000000</td>\n",
" <td>39.930150</td>\n",
" <td>-87.603617</td>\n",
" </tr>\n",
" <tr>\n",
" <th>75%</th>\n",
" <td>5902.500000</td>\n",
" <td>777.250000</td>\n",
" <td>40.960828</td>\n",
" <td>-74.310179</td>\n",
" </tr>\n",
" <tr>\n",
" <th>max</th>\n",
" <td>24560.000000</td>\n",
" <td>9166.000000</td>\n",
" <td>47.916786</td>\n",
" <td>-70.758184</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" gay tax rate overall tax paid lat long\n",
"count 2184.000000 2184.000000 2184.000000 2184.000000\n",
"mean 4373.997253 596.719322 38.016518 -91.296804\n",
"std 3054.620840 615.174358 5.210272 18.476699\n",
"min 0.000000 0.000000 25.572213 -123.118977\n",
"25% 2110.000000 217.000000 33.997027 -105.037767\n",
"50% 3900.000000 434.000000 39.930150 -87.603617\n",
"75% 5902.500000 777.250000 40.960828 -74.310179\n",
"max 24560.000000 9166.000000 47.916786 -70.758184"
]
},
2023-04-13 19:45:53 +00:00
"execution_count": 13,
2023-03-07 08:41:48 +00:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"gaydfhybridplot = pd.merge(gaydfgentaxplot, gaydfgaytaxplot)\n",
"\n",
"gaydfhybridplot.describe()\n"
]
},
{
"cell_type": "code",
2023-04-13 19:45:53 +00:00
"execution_count": 14,
2023-03-07 08:41:48 +00:00
"metadata": {},
"outputs": [
{
"data": {
2023-04-13 18:37:53 +00:00
"image/png": "iVBORw0KGgoAAAANSUhEU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rV+LJJ5/E/v378fjjj7t1nk116dIFTZo0wc6dO7nH1Go1unfvjlu3bmHChAmIiorCoUOHMHPmTNy5c8dsvebYsWOxatUq9O/fH+PGjYNer8f+/fvx119/oUOHDj75OzEMgyFDhmDv3r0YO3Ys2rZti99//x1Tp07FrVu3uFGeM2fOYNCgQWjdujUWLVoEsViMrKwsHDx40O75nDBhAm7fvo2dO3fif//7n9Pzf+bMGSQnJyM4OBjTpk2DUCjEV199hSeeeAJ//vknOnXqZHb8pEmTEBoaivnz5+PatWv4+OOPkZ6ejh9++MHh5+zatQv9+/dH48aNsWDBApSWlmLZsmVITEzEiRMnEBMTgwkTJqBBgwZ4++23MXnyZHTs2BF169Z1+h3sWbVqFQIDAzFlyhQEBgZiz549mDdvHgoLC7F06VIAQPPmzbF48WJMnToVTz/9NIYMGYKSkhKkpqaiWbNmZnnLlfebPXs2VCoVbt68yf2OgYGBlTovpp599lnExsZiyZIlOHHiBL755htERETg3XfftfsZERER8Pf3x5YtWzBp0iSEhYXZPM5ZOfDTTz9BrVbj3//+N8LDw/H3339j2bJluHnzJn766ScA7l9/L7/8Mn7++Wekp6ejRYsWyMvLw4EDB3Du3Dm0a9fO7fN56tQpJCcnQygUYvz48YiJicHly5exZcsWvPXWWy59pruysrLw9NNPY+zYsUhJScGKFSuQmpqK9u3bo2XLlnZft2X
2023-03-07 08:41:48 +00:00
"text/plain": [
"<Figure size 1000x1000 with 20 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
2023-04-13 18:37:53 +00:00
"plt = sns.pairplot(gaydfhybridplot)\n",
"_ = plt.figure.suptitle(\"Complete Decomposition of Taxation Statistics in Queer Communities\")\n",
"plt.figure.subplots_adjust(top=0.925)"
2023-03-07 08:41:48 +00:00
]
},
{
"cell_type": "code",
2023-04-13 19:45:53 +00:00
"execution_count": 15,
2023-03-07 08:41:48 +00:00
"metadata": {},
"outputs": [
{
"data": {
2023-04-13 18:37:53 +00:00
"image/png": "iVBORw0KGgoAAA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4uMjGRr165lMTExbODAgQwA9+XLWM3+/pRKJfP09GSurq7s/fffZ9u2bWNLly5l3bt3Z3fv3n2m93Pnzp2Mx+MxX19ftmLFCrZp0yY2adIk9sorr1T7nBWpKAjw9/dnXl5ebNWqVWz16tVMJpOxFi1a6P3+DOnduzcTi8WsqKiowjJ9+/Zl5ubmrLCwkDFWsyDgiy++YDwejw0aNIjFxMSwVatWMQ8PD2Zra6tXrrrft7pz+Pj4sL59+7KYmBj24YcfVlj3cePGMQDc56oqNf0u8vHxYa+//jrbtGkT6927N3cBdnV1ZXPmzGExMTGsQ4cOTCAQsDt37pQ7T+fOndmgQYPYpk2b2CuvvMIAsLlz57KgoCA2btw4tnnzZjZ06FAGgO3evZt7fk2DgOp+b5YOAqr6LJYNAvLz81nHjh2Zg4MDe+edd9jWrVvZq6++yng8HnvzzTe5cr/88gsDwAYMGMA2bdrENm3axKKjo9moUaOq9Tvi6lqTwlUFAYwxJpVKmb+/P/d4wIABzM/PT+/DodVqWe/evZm3tze3bfHixQyA3h9q6fKMMbZu3ToGgP3f//0ft0+lUrGAgABmbW3NFAoFY+zpL7BZs2Z6dwQLFixgAFinTp30vkDHjh3LhEKhXh11d0Gl7/zlcjlzcXHRe30zZ87kIlGd3Nxc5unpyTw8PLjIbfjw4axDhw4Vvm+MGf7wd+jQgbv
2023-03-07 08:41:48 +00:00
"text/plain": [
"<Figure size 500x500 with 6 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"gaydflight = gaydfhybridplot.copy()\n",
"\n",
"del gaydflight['lat']; del gaydflight['long']\n",
2023-03-03 09:13:54 +00:00
"\n",
2023-04-13 18:37:53 +00:00
"plt = sns.pairplot(gaydflight)\n",
"_ = plt.figure.suptitle(\"Decomposition of Taxation Statistics in Queer Communities\")\n",
"plt.figure.subplots_adjust(top=0.925)\n"
2023-03-03 08:51:14 +00:00
]
2023-03-03 09:13:54 +00:00
},
{
2023-04-13 18:37:53 +00:00
"cell_type": "markdown",
2023-03-03 09:13:54 +00:00
"metadata": {},
2023-03-07 08:41:48 +00:00
"source": [
2023-04-13 18:37:53 +00:00
"As we can infer by taking the first derivative of the corelation line of this graph, queer communities pay significantly more taxes then typical neighborhoods. An explanation for this is queer people through one mechanism or another (queer folk being more likely to be politically progressive, live in cities, or get educations for example) end up corelating strongly with demographics who pay more tax\n",
2023-03-07 08:41:48 +00:00
"\n",
2023-04-13 18:37:53 +00:00
"Do note that the analysis is severely limited by severe sampling bias as only hyper urban geographical stratum have been surveyed by gayborhoods"
2023-04-13 09:42:51 +00:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**How are the different metrics of pride represented in this data set correlated?**\n"
]
},
{
"cell_type": "code",
2023-04-13 19:45:53 +00:00
"execution_count": 16,
2023-04-13 09:42:51 +00:00
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>GEOID10</th>\n",
" <th>Tax_Mjoint</th>\n",
" <th>Mjoint_MF</th>\n",
" <th>Mjoint_SS</th>\n",
" <th>Mjoint_FF</th>\n",
" <th>Mjoint_MM</th>\n",
" <th>TaxRate_SS</th>\n",
" <th>TaxRate_FF</th>\n",
" <th>TaxRate_MM</th>\n",
" <th>Cns_TotHH</th>\n",
" <th>...</th>\n",
" <th>FF_Cns</th>\n",
" <th>FF_Index</th>\n",
" <th>MM_Tax</th>\n",
" <th>MM_Cns</th>\n",
" <th>MM_Index</th>\n",
" <th>SS_Index</th>\n",
" <th>SS_Index_Weight</th>\n",
" <th>Parade_Weight</th>\n",
" <th>Bars_Weight</th>\n",
" <th>TOTINDEX</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>90069</td>\n",
" <td>2120</td>\n",
" <td>1689</td>\n",
" <td>431</td>\n",
" <td>61</td>\n",
" <td>370</td>\n",
" <td>203.301887</td>\n",
" <td>28.773585</td>\n",
" <td>174.528302</td>\n",
" <td>12551</td>\n",
" <td>...</td>\n",
" <td>1.847099</td>\n",
" <td>6.724415</td>\n",
" <td>29.583721</td>\n",
" <td>18.704533</td>\n",
" <td>48.288254</td>\n",
" <td>55.012669</td>\n",
" <td>39.429995</td>\n",
" <td>10</td>\n",
" <td>17.647059</td>\n",
" <td>67.077054</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>94114</td>\n",
" <td>5080</td>\n",
" <td>4036</td>\n",
" <td>1044</td>\n",
" <td>170</td>\n",
" <td>874</td>\n",
" <td>205.511811</td>\n",
" <td>33.464567</td>\n",
" <td>172.047244</td>\n",
" <td>16456</td>\n",
" <td>...</td>\n",
" <td>4.161579</td>\n",
" <td>9.834048</td>\n",
" <td>29.163165</td>\n",
" <td>19.415304</td>\n",
" <td>48.578469</td>\n",
" <td>58.412517</td>\n",
" <td>41.866815</td>\n",
" <td>0</td>\n",
" <td>20.000000</td>\n",
" <td>61.866815</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>10011</td>\n",
" <td>5790</td>\n",
" <td>5166</td>\n",
" <td>624</td>\n",
" <td>97</td>\n",
" <td>527</td>\n",
" <td>107.772021</td>\n",
" <td>16.753022</td>\n",
" <td>91.018998</td>\n",
" <td>29762</td>\n",
" <td>...</td>\n",
" <td>1.531029</td>\n",
" <td>4.370779</td>\n",
" <td>15.428332</td>\n",
" <td>10.932081</td>\n",
" <td>26.360413</td>\n",
" <td>30.731192</td>\n",
" <td>22.026394</td>\n",
" <td>10</td>\n",
" <td>5.882353</td>\n",
" <td>37.908747</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>10014</td>\n",
" <td>3510</td>\n",
" <td>3229</td>\n",
" <td>281</td>\n",
" <td>74</td>\n",
" <td>207</td>\n",
" <td>80.056980</td>\n",
" <td>21.082621</td>\n",
" <td>58.974359</td>\n",
" <td>18786</td>\n",
" <td>...</td>\n",
" <td>2.482293</td>\n",
" <td>6.055939</td>\n",
" <td>9.996551</td>\n",
" <td>5.943318</td>\n",
" <td>15.939869</td>\n",
" <td>21.995808</td>\n",
" <td>15.765361</td>\n",
" <td>10</td>\n",
" <td>11.764706</td>\n",
" <td>37.530067</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>94103</td>\n",
" <td>2660</td>\n",
" <td>2417</td>\n",
" <td>243</td>\n",
" <td>34</td>\n",
" <td>209</td>\n",
" <td>91.353383</td>\n",
" <td>12.781955</td>\n",
" <td>78.571429</td>\n",
" <td>12728</td>\n",
" <td>...</td>\n",
" <td>0.837431</td>\n",
" <td>3.004058</td>\n",
" <td>13.318386</td>\n",
" <td>4.961779</td>\n",
" <td>18.280165</td>\n",
" <td>21.284224</td>\n",
" <td>15.255337</td>\n",
" <td>10</td>\n",
" <td>10.588235</td>\n",
" <td>35.843573</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>5 rows × 29 columns</p>\n",
"</div>"
],
"text/plain": [
" GEOID10 Tax_Mjoint Mjoint_MF Mjoint_SS Mjoint_FF Mjoint_MM \\\n",
"0 90069 2120 1689 431 61 370 \n",
"1 94114 5080 4036 1044 170 874 \n",
"2 10011 5790 5166 624 97 527 \n",
"3 10014 3510 3229 281 74 207 \n",
"4 94103 2660 2417 243 34 209 \n",
"\n",
" TaxRate_SS TaxRate_FF TaxRate_MM Cns_TotHH ... FF_Cns FF_Index \\\n",
"0 203.301887 28.773585 174.528302 12551 ... 1.847099 6.724415 \n",
"1 205.511811 33.464567 172.047244 16456 ... 4.161579 9.834048 \n",
"2 107.772021 16.753022 91.018998 29762 ... 1.531029 4.370779 \n",
"3 80.056980 21.082621 58.974359 18786 ... 2.482293 6.055939 \n",
"4 91.353383 12.781955 78.571429 12728 ... 0.837431 3.004058 \n",
"\n",
" MM_Tax MM_Cns MM_Index SS_Index SS_Index_Weight Parade_Weight \\\n",
"0 29.583721 18.704533 48.288254 55.012669 39.429995 10 \n",
"1 29.163165 19.415304 48.578469 58.412517 41.866815 0 \n",
"2 15.428332 10.932081 26.360413 30.731192 22.026394 10 \n",
"3 9.996551 5.943318 15.939869 21.995808 15.765361 10 \n",
"4 13.318386 4.961779 18.280165 21.284224 15.255337 10 \n",
"\n",
" Bars_Weight TOTINDEX \n",
"0 17.647059 67.077054 \n",
"1 20.000000 61.866815 \n",
"2 5.882353 37.908747 \n",
"3 11.764706 37.530067 \n",
"4 10.588235 35.843573 \n",
"\n",
"[5 rows x 29 columns]"
]
},
2023-04-13 19:45:53 +00:00
"execution_count": 16,
2023-04-13 09:42:51 +00:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import pandas as pd\n",
"import seaborn as sns\n",
"import numpy as np\n",
"\n",
"gaybourhoods = pd.read_csv(\"../data/raw/gaybourhoods.csv\")\n",
"gaybourhoods.head(5)"
]
},
{
"cell_type": "code",
2023-04-13 19:45:53 +00:00
"execution_count": 17,
2023-04-13 09:42:51 +00:00
"metadata": {},
"outputs": [
{
2023-04-13 18:37:53 +00:00
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>pride parade index</th>\n",
" <th>gay bars index</th>\n",
" <th>lat</th>\n",
" <th>long</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>count</th>\n",
" <td>2328.000000</td>\n",
" <td>2328.000000</td>\n",
" <td>2328.000000</td>\n",
" <td>2328.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>mean</th>\n",
" <td>0.017612</td>\n",
" <td>0.118127</td>\n",
" <td>38.044304</td>\n",
" <td>-91.221236</td>\n",
" </tr>\n",
" <tr>\n",
" <th>std</th>\n",
" <td>0.131563</td>\n",
" <td>0.861863</td>\n",
" <td>5.148365</td>\n",
" <td>18.533499</td>\n",
" </tr>\n",
" <tr>\n",
" <th>min</th>\n",
" <td>0.000000</td>\n",
" <td>0.000000</td>\n",
" <td>25.572213</td>\n",
" <td>-123.118977</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25%</th>\n",
" <td>0.000000</td>\n",
" <td>0.000000</td>\n",
" <td>34.021932</td>\n",
" <td>-105.049099</td>\n",
" </tr>\n",
" <tr>\n",
" <th>50%</th>\n",
" <td>0.000000</td>\n",
" <td>0.000000</td>\n",
" <td>39.899977</td>\n",
" <td>-87.494097</td>\n",
" </tr>\n",
" <tr>\n",
" <th>75%</th>\n",
" <td>0.000000</td>\n",
" <td>0.000000</td>\n",
" <td>40.912413</td>\n",
" <td>-74.288743</td>\n",
" </tr>\n",
" <tr>\n",
" <th>max</th>\n",
" <td>1.000000</td>\n",
" <td>17.000000</td>\n",
" <td>47.916786</td>\n",
" <td>-70.758184</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" pride parade index gay bars index lat long\n",
"count 2328.000000 2328.000000 2328.000000 2328.000000\n",
"mean 0.017612 0.118127 38.044304 -91.221236\n",
"std 0.131563 0.861863 5.148365 18.533499\n",
"min 0.000000 0.000000 25.572213 -123.118977\n",
"25% 0.000000 0.000000 34.021932 -105.049099\n",
"50% 0.000000 0.000000 39.899977 -87.494097\n",
"75% 0.000000 0.000000 40.912413 -74.288743\n",
"max 1.000000 17.000000 47.916786 -70.758184"
]
},
2023-04-13 19:45:53 +00:00
"execution_count": 17,
2023-04-13 18:37:53 +00:00
"metadata": {},
"output_type": "execute_result"
2023-04-13 09:42:51 +00:00
}
],
"source": [
"#wrangle gay\n",
"# gaydf = pd.DataFrame(zip(gaybourhoods['GEOID10'], gaybourhoods['Parade_Weight'], gaybourhoods['Bars_Weight']))\n",
"\n",
"\n",
"# print(gaydf.describe())\n",
"# print(gaydf)\n",
"\n",
"cords = pd.read_csv(\"../data/raw/zip_lat_long.csv\")\n",
"\n",
2023-04-13 10:33:02 +00:00
"# gaydf = pd.DataFrame(zip(gaybourhoods['GEOID10'], gaybourhoods['ParadeFlag'], gaybourhoods['CountBars']))\n",
"# gaydf.columns=(('zip', 'pride parade index', 'gay bars index'))\n",
"# gaydf = gaydf.merge(cords, left_on=\"zip\", right_on=\"ZIP\")\n",
"\n",
"\n",
"def loadprideindexes(secdf):\n",
" gaydf = pd.DataFrame(zip(gaybourhoods['GEOID10'], gaybourhoods['ParadeFlag'], gaybourhoods['CountBars']))\n",
" gaydf.columns=(('zip', 'pride parade index', 'gay bars index'))\n",
" gaydf = gaydf.merge(secdf, left_on=\"zip\", right_on=\"ZIP\")\n",
" \n",
" return gaydf\n",
" \n",
" # gaydf = (\n",
" # pd.DataFrame(zip(gaybourhoods['GEOID10'], gaybourhoods['ParadeFlag'], gaybourhoods['CountBars']))\n",
" # .columns=(('zip', 'pride parade index', 'gay bars index'))\n",
" # # .merge(cords, left_on=\"zip\", right_on=\"ZIP\")\n",
" # )\n",
"\n",
"gaydf = loadprideindexes(cords)\n",
"\n",
"def notzip(dat):\n",
" del dat['zip']\n",
" del dat['ZIP']\n",
"\n",
"notzip(gaydf)\n",
"\n",
2023-04-13 09:42:51 +00:00
"# // unneded was already filtered out\n",
"\n",
"# There's a lot of info baked into some of these columns. Especially the composite indexes.\n",
"# We'll leave their names as is for easy reference even if they're a little ugly.\n",
"gaydf = gaydf.rename({\n",
" \"LAT\": \"lat\",\n",
" \"LNG\": \"long\",\n",
"}, axis=\"columns\")\n",
"\n",
"# unperson unneccesary zip codes\n",
"# del gaydf['zip.1']\n",
"# del gaydf['ZIP']\n",
"\n",
"\n",
"gaydf.to_csv(\"../data/processed/gay_pride\", index=False)\n",
"\n",
2023-04-13 18:37:53 +00:00
"gaydf.describe()"
2023-04-13 09:42:51 +00:00
]
},
{
"cell_type": "code",
2023-04-13 19:45:53 +00:00
"execution_count": 18,
2023-04-13 09:42:51 +00:00
"metadata": {},
"outputs": [],
"source": [
"gaydf = pd.read_csv(\"../data/processed/gay_pride\")"
]
},
{
"cell_type": "code",
2023-04-13 19:45:53 +00:00
"execution_count": 19,
2023-04-13 09:42:51 +00:00
"metadata": {},
"outputs": [
{
"data": {
2023-04-13 18:37:53 +00:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjIAAAHHCAYAAACle7JuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/P9b71AAAACXBIWXMAAA9hAAAPYQGoP6dpAABp+UlEQVR4nO3dd3gU1f4G8He2901vpBBC71UJ0kSKiIpi+9kAG6hY0Styrw0btsu1otgAFcXeESwUEZAemhACBBLS626yvZzfH1z2upBAgCSbDe/nefbRnTk7+52TJfvmzJkZSQghQERERBSGZKEugIiIiOh0McgQERFR2GKQISIiorDFIENERERhi0GGiIiIwhaDDBEREYUtBhkiIiIKWwwyREREFLYYZIiIiChsMcgQnaEnnngCkiShvLw81KW0ei+++CLatWsHuVyO3r17N+l7rVy5EpIkYeXKlSdtO3z4cAwfPrzR3nvy5Mlo27Zto22vqbZJ1BIwyBCFsSVLluCJJ54IdRnN4ueff8ZDDz2E8847D/Pnz8ezzz4b6pKIqAVQhLoAIjp9S5YswRtvvHFWhJnly5dDJpPhvffeg0qlavL3Gzp0KBwOR7O817Heeecd+P3+Zn9fonDEIENEYaG0tBRarbbJg4XT6YRKpYJMJoNGo2nS96qPUqkMyfsShSMeWiJqJNXV1Zg8eTIiIiJgNptx0003wW63H9fuo48+Qr9+/aDVahEVFYX/+7//Q35+flCb1atX46qrrkJqairUajVSUlJw//33w+FwBNpMnjwZb7zxBgBAkqTAAwAOHjwISZLw0ksv4Y033kC7du2g0+kwevRo5OfnQwiBp556CsnJydBqtRg/fjwqKyuDavj2228xbtw4JCUlQa1WIyMjA0899RR8Pl9Qu+HDh6N79+7YvHkzBg0aBK1Wi/T0dLz11lsN6jev14unnnoKGRkZUKvVaNu2Lf75z3/C5XIF2kiShPnz58NmswX2c8GCBfVus6E1HZ0Hs3jxYjzyyCNo06YNdDodrFZrvXNk3n77bWRkZECr1eKcc87B6tWr66zB5XLh8ccfR/v27QM/w4ceeihov+pz7HyWv/88j76/Wq3GgAEDsHHjxuNe/80336B79+7QaDTo3r07vv766zrfx+/34+WXX0a3bt2g0WgQHx+PqVOnoqqqKtDm8ccfh0wmw2+//Rb02ilTpkClUmHbtm0n3R+iJiWI6Iw8/vjjAoDo06ePmDBhgpg7d6649dZbBQDx0EMPBbV9+umnhSRJ4pprrhFz584Vs2bNEjExMaJt27aiqqoq0O7uu+8WF110kXj22WfFvHnzxC233CLkcrm48sorA23Wrl0rRo0aJQCIDz/8MPAQQojc3FwBQPTu3Vt07dpVzJkzRzzyyCNCpVKJgQMHin/+859i0KBB4tVXXxX33HOPkCRJ3HTTTUG1XnbZZeLqq68WL774onjzzTfFVVddJQCIBx98MKjdsGHDRFJSkoiLixN33XWXePXVV8XgwYMFAPHee++dtP8mTZokAIgrr7xSvPHGG2LixIkCgLjssssCbT788EMxZMgQoVarA/u5f//+erfZ0JpWrFghAIiuXbuK3r17izlz5ojZs2cLm80WWLdixYpA+3fffVcACPTdfffdJyIiIkS7du3EsGHDAu18Pp8YPXq00Ol04r777hPz5s0Td911l1AoFGL8+PEN6pO0tLTA86M/zz59+oj27duL559/XrzwwgsiJiZGJCcnC7fbHWi7bNkyIZPJRPfu3cWcOXPEv/71L2E2m0W3bt2CtimEELfeeqtQKBTitttuE2+99ZaYMWOG0Ov1YsCAAYFtut1u0adPH5GWliasVqsQQoilS5cKAOKpp5466b4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+00:00
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"gaydfprideplot = gaydf.copy()\n",
"\n",
"plot3 = sns.scatterplot(data=gaydfprideplot, x=\"long\", y=\"lat\", hue=\"pride parade index\")\n",
2023-04-13 18:37:53 +00:00
"_ = plot3.set(xlabel=\"long\", ylabel=\"lat\", title = \"heatmap of pride index\")"
2023-04-13 09:42:51 +00:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2023-04-13 18:37:53 +00:00
"It seemed that most communities did not have a pride parade, but a number of them still did"
2023-04-13 09:42:51 +00:00
]
},
{
"cell_type": "code",
2023-04-13 19:45:53 +00:00
"execution_count": 20,
2023-04-13 09:42:51 +00:00
"metadata": {},
"outputs": [
{
"data": {
2023-04-13 18:37:53 +00:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjIAAAHHCAYAAACle7JuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/P9b71AAAACXBIWXMAAA9hAAAPYQGoP6dpAABuo0lEQVR4nO3dd5xU1f0//tetU3e2V7YAC1JEUCHq2rCgiGhssUfAGhULEg2Sj1+VGHtijA1LDFgw5meiiUlUYgFLREUQwYZ0lrIs26fPLef3x8DouLu4wM7OzvJ6Ph7zeDD3nrn3PXeXmdeee+65khBCgIiIiCgDyekugIiIiGhPMcgQERFRxmKQISIioozFIENEREQZi0GGiIiIMhaDDBEREWUsBhkiIiLKWAwyRERElLEYZIiIiChjMcgQAbj99tshSRIaGhrSXUqfd//992PgwIFQFAUHHnhgusvpMkmScM0116S7jF2aO3cuJEnC+vXre/U2iboTgwxRmr322mu4/fbb011Gj/jvf/+LX/3qVzjiiCMwZ84c3HXXXekuiYgyHIMMUZq99tprmDVrVrrL6BHvvPMOZFnG008/jUmTJuHkk09Od0l9ykUXXYRwOIyqqqp0l0LUYxhkiKjH1NfXw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npITJ8+XeTl5Ynq6moxduzYRLvt27eL0tJSMX36dDF79mxx3333iSFDhghN08Rnn32WaPd///d/QtM00djYmLSf/+//+/8EAPHee+/t8j0CECNGjBAFBQXiN7/5jbj33ntFVVWVcLlcYsWKFYl2L730khg1apS49dZbxZNPPil+/etfi9zcXFFVVSWCwWCi3Zw5cwQAMXz4cDF27Fjx8MMPi3vuuUcIIcQFF1wgdF0X06dPF3/605/EvffeK0499VTx/PPP77LGndtct25dYllVVZUYMmSIKC4uFr/+9a/FI488Ig4++GAhSZL44osvEu22bt0qCgsLRW5urrj99tvF/fffLwYPHixGjhzZbpvPPvuskCRJnHTSSeLhhx8W9957r+jfv7/IyclJajd16lShqqpYsmSJEEKILVu2iLy8PDFu3Dhh2/Yu3wtRVzHIEInvgswll1yStPyMM84Q+fn5iefr168XiqKIO++8M6ndihUrhKqqSctDoVC7/dx9991CkiSxYcOGxLKpU6eKjv6m2BlkCgsLRUtLS2L5zJkzBQAxatQoYRhGYvn5558vdF0XkUhklzX84he/EG63O6nd2LFjBQDx+9//PrEsGo2KAw88UBQVFYlYLNZuOzstW7ZMABCXXXZZ0vIbb7xRABDvvPNOYtnkyZOFx+PpdFvf33d+fr74yU9+kvQe586dKwAkBRnTNEU0Gk16fXNzsyguLk76ea5cuVIAELNnz05q+9Of/lT079//R79YAQgA4tNPP00s27Bhg3A6neKMM85ILOvomC9atEgAEM8++2xi2c7QceSRRwrTNJPaZ2dni6lTp+6yno50FmR+GNTq6+uFw+EQv/zlLxPLpk2bJgCIjz/+OKlddnZ20jb9fr/IyckRl19+edK+6+rqRHZ2dtLyYDAoBg0aJPbff38RiUTExIkThc/nS/r9J9pbPLVE9D1XXnll0vOjjjoKjY2NaGtrAwC8/PLLsG0b55xzDhoaGhKPkpISDB48OOl0hsvlSvw7GAyioaEBhx9+OIQQ+Oyzz7pc09lnn43s7OzE80MPPRQA8POf/xyqqiYtj8Vi2Lx5c4c1+P1+NDQ04KijjkIoFMI333yTtB9VVZNOr+i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9uPfee/Hyyy9jwoQJu13Tj/2u7I6d7+G5555DSUlJu/Xf70EDgGg0ioULFwIA1qx
2023-04-13 09:42:51 +00:00
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"gaydfgaybarsplot = gaydf.copy()\n",
"\n",
"plot4 = sns.scatterplot(data=gaydfprideplot, x=\"long\", y=\"lat\", hue=\"gay bars index\")\n",
"_ = plot4.set(xlabel=\"long\", ylabel=\"lat\", title = \"heatmap of gay bars index\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"it looks like certain communities had large numbers of bars but most didn't\n",
"\n",
"the next step is to find the distribution of gay bars"
]
},
{
"cell_type": "code",
2023-04-13 19:45:53 +00:00
"execution_count": 21,
2023-04-13 09:42:51 +00:00
"metadata": {},
"outputs": [
{
"data": {
2023-04-13 18:37:53 +00:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAkoAAAGwCAYAAABWwkp7AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/P9b71AAAACXBIWXMAAA9hAAAPYQGoP6dpAAAuTklEQVR4nO3de1xVdb7/8fdGuXgDVORWiJdS0ZRMk6i0UkZQM508pWWmE3bxQGU0jvk45q2ZLC11chidppTpjKZ1TlmpR0O8pngJJS8po4ViKVgqIKiAsH5/+GNPO/miILg3+no+HuvxYK31Wd/9WYu1t2/XXuxtsyzLEgAAAC7h5uwGAAAAXBVBCQAAwICgBAAAYEBQAgAAMCAoAQAAGBCUAAAADAhKAAAABvWd3UBdUFZWpmPHjqlJkyay2WzObgcAAFwBy7J05swZBQcHy82teteGCEpX4NixYwoJCXF2GwAAoBqOHj2qm2++uVrbEpSuQJMmTSRdPNDe3t5O7gYAAFyJ/Px8hYSE2P8drw6C0hUof7vN29uboAQAQB1zNbfNcDM3AACAAUEJAADAgKAEAABgQFACAAAwICgBAAAYEJQA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NmzY53D+0aNEidejQQX369FH//v117733OnxGko+Pj7788ktlZmaqW7duevnllzVp0iTjRwMAAACUc+rN3Pfff78syzKuX7169WXHaNasmRYvXlxpTZcuXbR
2023-04-13 09:42:51 +00:00
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plot5 = sns.histplot(gaydfgaybarsplot[\"gay bars index\"])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"looks like the hypothesis was right - most communities with gay bars had multiple"
]
},
{
"cell_type": "code",
2023-04-13 19:45:53 +00:00
"execution_count": 22,
2023-04-13 09:42:51 +00:00
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>pride parade index</th>\n",
" <th>gay bars index</th>\n",
" <th>lat</th>\n",
" <th>long</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>count</th>\n",
" <td>2328.000000</td>\n",
" <td>2328.000000</td>\n",
" <td>2328.000000</td>\n",
" <td>2328.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>mean</th>\n",
" <td>0.017612</td>\n",
" <td>0.118127</td>\n",
" <td>38.044304</td>\n",
" <td>-91.221236</td>\n",
" </tr>\n",
" <tr>\n",
" <th>std</th>\n",
" <td>0.131563</td>\n",
" <td>0.861863</td>\n",
" <td>5.148365</td>\n",
" <td>18.533499</td>\n",
" </tr>\n",
" <tr>\n",
" <th>min</th>\n",
" <td>0.000000</td>\n",
" <td>0.000000</td>\n",
" <td>25.572213</td>\n",
" <td>-123.118977</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25%</th>\n",
" <td>0.000000</td>\n",
" <td>0.000000</td>\n",
" <td>34.021932</td>\n",
" <td>-105.049099</td>\n",
" </tr>\n",
" <tr>\n",
" <th>50%</th>\n",
" <td>0.000000</td>\n",
" <td>0.000000</td>\n",
" <td>39.899977</td>\n",
" <td>-87.494097</td>\n",
" </tr>\n",
" <tr>\n",
" <th>75%</th>\n",
" <td>0.000000</td>\n",
" <td>0.000000</td>\n",
" <td>40.912413</td>\n",
" <td>-74.288743</td>\n",
" </tr>\n",
" <tr>\n",
" <th>max</th>\n",
" <td>1.000000</td>\n",
" <td>17.000000</td>\n",
" <td>47.916786</td>\n",
" <td>-70.758184</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
2023-04-13 10:33:02 +00:00
" pride parade index gay bars index lat long\n",
"count 2328.000000 2328.000000 2328.000000 2328.000000\n",
"mean 0.017612 0.118127 38.044304 -91.221236\n",
"std 0.131563 0.861863 5.148365 18.533499\n",
"min 0.000000 0.000000 25.572213 -123.118977\n",
"25% 0.000000 0.000000 34.021932 -105.049099\n",
"50% 0.000000 0.000000 39.899977 -87.494097\n",
"75% 0.000000 0.000000 40.912413 -74.288743\n",
"max 1.000000 17.000000 47.916786 -70.758184"
2023-04-13 09:42:51 +00:00
]
},
2023-04-13 19:45:53 +00:00
"execution_count": 22,
2023-04-13 09:42:51 +00:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"gaydfhybridplot2 = pd.merge(gaydfprideplot, gaydfgaybarsplot)\n",
"\n",
"gaydfhybridplot2.describe()"
]
},
{
"cell_type": "code",
2023-04-13 19:45:53 +00:00
"execution_count": 23,
2023-04-13 09:42:51 +00:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
2023-04-13 19:45:53 +00:00
"<seaborn.axisgrid.PairGrid at 0x7f6445ecacb0>"
2023-04-13 09:42:51 +00:00
]
},
2023-04-13 19:45:53 +00:00
"execution_count": 23,
2023-04-13 09:42:51 +00:00
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
2023-04-13 18:37:53 +00:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA9oAAAPaCAYAAABoFyBHAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/P9b71AAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdeXiU9b3//9dknWwzxIxhjYom1qOAUPhKLUu1pVK1UJHz/ar1VMXWntMW9ZQugvuCoPZUrdZK3dtzTo+eliM/q62tpVIWOVI1FNSKBFECyJKQzCSzZDLL749kxiSzJ/dsyfNxXbmUe33fn23u9yz3xxQMBoMCAAAAAACGKMh2AAAAAAAADCck2gAAAAAAGIhEGwAAAAAAA5FoAwAAAABgIBJtAAAAAAAMRKINAAAAAICBSLQBAAAAADAQiTYAAAAAAAYi0U5RMBiUw+FQMBjMdigARJ8Ecgn9Ecgd9Ecgu0i0U9TR0SGr1aqOjo5shwJA9Ekgl9AfgdxBfwSyi0QbAAAAAAADkWgDAAAAAGAgEm0AAAAAAAxEog0AAAAAgIFItAEAAAAAMFBRtgMYio0bN+pHP/qR3nzzTX388cd6/vnnddFFF8XdZ8OGDVq2bJneeecd1dXV6eabb9ZVV12VkXgBZN7+Npc6PD453N2ylhWr0lykCdXlhmyf6rEPtLnk6LN9lblI42Nsb3d51dLplcPTLUtZsWwVJbKWlxh2nemSStyplEeqx85XI+Eapdy6TrvLqyMdXWp3dauitFDmokIVmKTuQECFBQWqyWBshx0etTm96uzyqaaiRF3+gBzublnMxbKUFWvcqLKMxCElP6YcbHfL7u4Ob9c3zsMOj9pdXgWDUlCSs8unKnORRpWXaLTFPOjzjKooVkVJUb/90lk+oXpxeHyylBWpuk/8qYpXXtlyxOGRs8snV7dfri6/LGVFqihN/jUkF69pMIys50SSGQONHieTqadU63IoZZbq9SUaa0JxWHvbb2eXT3ZX4nuidLbfvE60nU6nz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h7uksn2qxx6fYPu+D/6ylpfonsVTIl6E5jbYdO/iKRG/y0o1lnRJJe5UyiPVY+erkXCNUm5dZyiWOQNi6XnqeINOOb5SY61l2vWxI+2xjbaYtaq3Tzy1ea+WzJoYkfyE+ke6f/Oa7JgyblRZzO3GW8u0atFk/f2gPea1rLpokmbV21I+T6h8Yu1nZPn0rZeI+BdNTul3u/HKKxP1Gs1oi1mzT6nRtZ9viKijnqeOx38NycVrGgwj6zmRZMZAo8fJZOop1bocSpmlen3xYptVb4u5bsmsiXpq895+19G3PWei/eb1U8c7OzvV1NTzQIxp06bp/vvv17nnnqvjjjtOJ5xwglasWKEDBw7ol7/8paSe6b0mTZqk73znO7r66qv15z//Wdddd51eeumlpKf3Svap49u3b9e0adN03s3PqLru1JSuq635ff1x5VVqbGzU1KlTU9oXGGkS9cnQHK0dnm5VmXvmak5mHu1ktk/12KF5o0PbW5KYRzu0ra0yuXm0k40lXVKJO5XySPXY+SrfrzHZ18hcus7wPNrubpWXfDKPti8QVGGBKSfm0a4y93zilI15tBONKaE5aEPb9Y0z2jzaleb+c+0O5jzWsmJVlBb12y+d5dNvrmBzkaorhj6PdibiTrY/DpxHu6qsSJWDmEc7E9eUTkbWcyLJjIFGj5PJ1FOqdTmUMkv1+hKNNX3n867snUc7NH7GuydKZ/vN60R7w4YNOvfccyOWX3nllXrmmWd01VVX6cMPP9SGDRv67fPd735X7777riZMmKBbbrlFV111VdLnJNEGcgtT7gG5g/4I5A76I5Bdef0wtHPOOUfx3id45plnou7T2NiYxqgAAAAAACP
2023-04-13 09:42:51 +00:00
"text/plain": [
"<Figure size 1000x1000 with 20 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
2023-04-13 10:33:02 +00:00
"# del gaydfhybridplot2['zip']; del gaydfhybridplot2['ZIP']\n",
2023-04-13 09:42:51 +00:00
"\n",
"sns.pairplot(gaydfhybridplot2)"
]
},
{
"cell_type": "code",
2023-04-13 19:45:53 +00:00
"execution_count": 24,
2023-04-13 09:42:51 +00:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
2023-04-13 19:45:53 +00:00
"<seaborn.axisgrid.PairGrid at 0x7f644683a2c0>"
2023-04-13 09:42:51 +00:00
]
},
2023-04-13 19:45:53 +00:00
"execution_count": 24,
2023-04-13 09:42:51 +00:00
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
2023-04-13 18:37:53 +00:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAfAAAAHwCAYAAABZrD3mAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/P9b71AAAACXBIWXMAAA9hAAAPYQGoP6dpAABT3UlEQVR4nO3deVwV9f4/8NdhO4f1oB4BUQQX0lTAha+Emcs3jNSLWt571byKa2UhKppCV8UsRa3Q7Guau3UrvUV6c0krrrgkSeJaJgJiuLGpcFiEwzK/P/p58sh2hrPAwOv5eJzHgzPzmZn3HGZ4MXNmPiMTBEEAERERSYpFYxdARERE4jHAiYiIJIgBTkREJEEMcCIiIgligBMREUkQA5yIiEiCGOBEREQSxAAnIiKSoBYX4IIgQK1Wg/3XEJke9zci02lxAV5YWAilUonCwsLGLoWo2eP+RmQ6LS7AiYiImgMGOBERkQQxwImIiCSIAU5ERCRBVo258OPHj+Pdd99FcnIy7ty5g71792LMmDF1TpOQkICIiAj8+uuv8PDwwOLFizFlyhSz1EtExnXzfgkKSyugflAOpa01HBRW6NDKzqxtb90vgfqRto4KK7SvpW1BiQZ5RRqoS8vhZGsNlb0NlHY2BtdgKmLqNdXnIDVSWrdGDfDi4mL4+flh2rRpePHFF+ttn5GRgZEjR+LVV1/FZ599hvj4eMyYMQPt2rVDcHCwGSomImP5/W4x3tx7CT+m3dUOG9i1DVa84APPNvZNru3t/AdYFHcRJ1LztMMGeauwaqwv3J1tGzxfUzFVvWLmKzVSWzeZ0ERu0JTJZPUegS9atAgHDx7EL7/8oh02fvx45Ofn4/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7O1hmenZ0NNze3GqdZsmQJJk2ahBkzZsDHxwcvvPACVq5ciZiYGFRVVdU4TVRUFAoKCrSvGzdu6F0jEYnD/Y3IfEQHeGRkJC5cuICEhAQoFArt8KCgIOzevVvv+djY2KBfv36Ij4/XDquqqkJ8fDwCAwNrnKakpAQWFrolW1paAgAEQahxGrlcDicnJ50XEZkG9zci8xH9Hfi+ffuwZ88ePPXUU5DJZNrhPXv2RHp6uqh5RUREIDQ0FP7+/ujfvz/WrVuH4uJiTJ06FQAwefJktG/fHjExMQCAkJAQxMbGok+fPggICEBaWhqWLFmCkJAQbZATERG1BKIDPDc3t8Z7tIuLi3UCXR/jxo1Dbm4uli5diqysLPTu3RuHDx/WXtiWmZmpc8S9ePFiyGQyLF68GLdu3ULbtm0REhKCFStWiF0NIiIiSRMd4P7+/jh48CBmz54NANrQ3rp1a62nvusSFhaGsLCwGsclJCTovLeyskJ0dDSio6NFL4eIiKg5ER3gK1euxPDhw3H58mVUVFTggw8+wOXLl3Hq1CkcO3bMFDUSERHRY0RfxDZw4ECcP38eFRUV8PHxwXfffQcXFxckJiaiX79+pqiRiIiIHtOgvtC7dOmCLVu2GLsWIiIi0pNeAS6mNyXeNkJERGR6egW4s7Oz3leYV1ZWGlQQERER1U+vAD969Kj25+vXryMyMhJTpkzRXnWemJiIXbt2ae/XJiIiItPSK8AHDx6s/Xn58uWIjY3FhAkTtMNGjRoFHx8fbN68GaGhocavkoiIiHSIvgo9MTER/v7+1Yb7+/vzudxERERmIjrAPTw8arwCfevWrXzyEBERkZmIvo1s7dq1GDt2LL799lsEBAQAAJKSkpCamoq4uDijF0hERETViT4CHzFiBFJTUxESEoJ79+7h3r17CAkJwdWrVzFixAhT1EhERESPaVBHLh06dMDKlSuNXQsRERHpqUEBnp+fj6SkJOTk5KCqqkpn3OTJk41SGBEREdVOdIDv378fEyd
2023-04-13 09:42:51 +00:00
"text/plain": [
"<Figure size 500x500 with 6 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"gaydflight2 = gaydfhybridplot2.copy()\n",
"\n",
"del gaydflight2['lat']; del gaydflight2['long']\n",
"\n",
"sns.pairplot(gaydflight2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"to find a correlation we remove the zero value & find correlation"
]
},
{
"cell_type": "code",
2023-04-13 19:45:53 +00:00
"execution_count": 25,
2023-04-13 09:42:51 +00:00
"metadata": {},
"outputs": [
{
"data": {
2023-04-13 18:37:53 +00:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAfAAAAHyCAYAAAAUZJztAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/P9b71AAAACXBIWXMAAA9hAAAPYQGoP6dpAABtV0lEQVR4nO3dd1gUV9sG8Hspu0tdVLoiWLCDKEaCNUYMorHF5DXGKNYUgxqJNbEbW6LYothiiTHRN5pqjTGiRokmihpjQ0SxKxaW6lLO94cf87LUXXYpK/fvuva62DNnzjwzzOyzM3PmrEwIIUBEREQmxayiAyAiIiL9MYETERGZICZwIiIiE8QETkREZIKYwImIiEwQEzgREZEJYgInIiIyQUzgREREJogJnIiIyAQxgVOZ2rhxI2QyGa5du1Zi3aioKMhkMkRFRZV5XIbYvHkzGjVqBEtLSzg4OFR0OFQJmMq+q68ZM2ZAJpMZrb3BgwfDy8vLaO1VdVU+gecmmNyXUqmEu7s7goODsWzZMiQnJ1d0iM+dlStXYuPGjRUdRqlcvHgRgwcPRr169bB27VqsWbOmxHnOnj2LIUOGoE6dOlAqlbC1tYWfnx8mTJiAq1evlkPU2vLv8zKZDM7OzujUqRP27NlT7vHk5+/vj5EjRwJ49oGfN057e3s0b94cixYtwtOnTys40rL14MEDjBkzBo0aNYKVlRWcnZ3RunVrTJw4ESkpKVK9b775BkuWLCn1ctLS0jBjxgyjffm4ffs2ZsyYgdOnTxulPSqGqOI2bNggAIhZs2aJzZs3i/Xr14u5c+eKV155RchkMuHp6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qYWVlJT766KMC8zdp0kS8/PLLxS4jd5v+9ttv4sGDB+L+/fvi3Llz4t133y2wLwghRK1atcTIkSPFF198ISIiIkTr1q0FAOkydy4AonHjxsLJyUnMnDlTrFixQsTExIhff/1VABCdO3cWK1asECtWrBBhYWHijTfe0Jpfo9EIe3t78cUXX0hloaGhwsbGpsA65P4fLl68KP766y9Rr149MWnSJLF69Woxa9YsUbNmTaFSqcStW7ekeXL3ryZNmgg/Pz8REREh5s2bJ1JTU3VuIy0tTTRo0EAolUoxYcIEsWTJEuHv7y98fX0L7LsHDhwQcrlcBAYGikWLFonFixcLX19fIZfLxfHjx4v9H82dO1cAEBs3biy23q+//ir8/PyEo6OjdDz98MMPQohnl8bd3NxEeHi4iIyMFJ999plo2LChsLS0lD5/UlJSpNtCffr0kdrI3a9zj4tc586dE3K5XLRq1UosXbpUrFq1SowbN0506NBBCPHss2PWrFkCgHjnnXek9uLi4qT/Z/7L/YMHDxYAREhIiFiyZIlYuHCh6NWrl1i+fLlOy6zKmMBLSOBCCKFSqUSLFi2k9507dxY+Pj5a93JycnJEmzZthLe3t1Q2bdo0AUAr6eWtL4QQS5YsEQDE119/LU3TaDQiMDBQ2NraCrVaLYT4XwJ3cnIST548kepOnjxZABDNmzcXmZmZUnn//v2FXC7XitHT01MAEDt27JDKkpKShJubm9b6ffjhhwKAOHLkiFSWnJws6tSpI7y8vKR71L169RJNmzYtcrsJUTCBC1H0PfD8CVyj0QhnZ2fRrFkzrftwO3fuFADEtGnTpLLQ0FDpvm5eLVq0EP7+/sXGeP/+fSGXy8Urr7yidf/9iy++EADE+vXrpbLcD7QHDx4U2+aZM2cEAPHhhx8WmPbw4UPx4MED6fX06VNpWlpaWoH68+bNEzKZTFy/fl0q69+/v3B3d9eK99SpU0Xee8wr93+S/6VQKApNGPlj0mg0olmzZgW+KAA
2023-04-13 09:42:51 +00:00
"text/plain": [
"<Figure size 500x500 with 6 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"gaydflight3 = gaydflight2[gaydflight2['gay bars index'] != 0]\n",
"# gaydflight3 = gaydflight3[gaydflight3['pride parade index'] != 0]\n",
"\n",
2023-04-13 18:37:53 +00:00
"plt = sns.pairplot(gaydflight3)\n",
"_ = plt.figure.suptitle(\"Decomposition of Gay Bars/Parade Statistics\")\n",
"plt.figure.subplots_adjust(top=0.925)"
2023-04-13 09:42:51 +00:00
]
},
{
"cell_type": "code",
2023-04-13 19:45:53 +00:00
"execution_count": 26,
2023-04-13 09:42:51 +00:00
"metadata": {},
"outputs": [
{
"data": {
2023-04-13 18:37:53 +00:00
"text/plain": [
2023-04-13 19:45:53 +00:00
"<seaborn.axisgrid.FacetGrid at 0x7f64466a7ca0>"
2023-04-13 18:37:53 +00:00
]
},
2023-04-13 19:45:53 +00:00
"execution_count": 26,
2023-04-13 18:37:53 +00:00
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAlUAAAIACAYAAACrRZn2AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/P9b71AAAACXBIWXMAAA9hAAAPYQGoP6dpAABT9klEQVR4nO3de3zO9eP/8edsdrDN2LBZzGkOcxo5JWSiWCyHinzEkFLkkE/EpxxLc/hUjp8p5ZQJFZIKS7QcYxolp2lGmTObDTPb+/dHP9e3qw275m3XzON+u12326734Xo/r/e2PHu933tdDoZhGAIAAMAdKWLvAAAAAIUBpQoAAMAElCoAAAATUKoAAABMQKkCAAAwAaUKAADABJQqAAAAE1CqAAAATECpAgAAMAGlCkCuhYSEKCQkxN4x8uTo0aNycHDQggULbrtt7969VbFixbueqaCx5RwByI5SdR9JSEjQK6+8omrVqqlYsWIqVqyYatasqYEDB2rv3r35nmfTpk1ycHCwenh7e+uhhx5SVFRUvucpaEJCQrKdm0aNGmnevHnKysqyd7x8V7FiRavzUaZMGbVo0UIrV660d7TbGjdunFX2G797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1NTXbug8++EDR0dFavHhxtnXnz5/XkCFD5OvrKzc3N8s/BJKsCkyNGjXUqFEjqykQoqKi9NBDDykwMDBXGevUqaM2bdqoTZs26tq1qxYvXqwOHTpo5MiROnPmjGW
2023-04-13 09:42:51 +00:00
"text/plain": [
"<Figure size 613.986x500 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"gaydflightparade = gaydflight3[gaydflight3['pride parade index'] != 0]\n",
"\n",
"gaydflightnoparade = gaydflight3[gaydflight3['pride parade index'] != 1]\n",
"\n",
"g = sns.catplot(\n",
" data=gaydflight3, kind=\"bar\",\n",
" x='pride parade index', y='gay bars index', hue='gay bars index'\n",
2023-04-13 18:37:53 +00:00
")\n",
"\n",
"g.set(title=\"Gay Bars vs. Passing Pride Parades\", ylabel=\"Gay Bars\", xlabel=\"Passing Pride Parades\")"
2023-04-13 09:42:51 +00:00
]
},
{
"cell_type": "code",
2023-04-13 19:45:53 +00:00
"execution_count": 27,
2023-04-13 09:42:51 +00:00
"metadata": {},
"outputs": [
{
"data": {
2023-04-13 18:37:53 +00:00
"text/plain": [
2023-04-13 19:45:53 +00:00
"<seaborn.axisgrid.FacetGrid at 0x7f6445a04ac0>"
2023-04-13 18:37:53 +00:00
]
},
2023-04-13 19:45:53 +00:00
"execution_count": 27,
2023-04-13 18:37:53 +00:00
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAm8AAAIACAYAAADUlIsHAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/P9b71AAAACXBIWXMAAA9hAAAPYQGoP6dpAABNWUlEQVR4nO3deXRMB8PH8d9IJCIiJCQRJJbYG6G2qqq1lpJa2lpeJXi0WjstpX1s9Wgsb+0aSm0tLVW05SlStdS+NaUborG0diEhiEju+0ePeTsSJGkyM1e/n3PmHHPX39yM+LmrxTAMQwAAADCFPI4OAAAAgMyjvAEAAJgI5Q0AAMBEKG8AAAAmQnkDAAAwEcobAACAiVDeAAAATITyBgAAYCKUNwAAABOhvAF4qIYNG6phw4aOjpEtJ06ckMVi0aJFix46bffu3VWqVKlcz+RssrKNADge5e0fIC4uTv369VP58uWVP39+5c+fX5UrV1bfvn116NAhu+fZsmWLLBaLzcvHx0dPPPGEli5davc8zqZhw4bptk2tWrW0YMECpaWlOTqe3ZUqVcpme/j5+al+/fpavXq1o6M91JgxY2yy3/279+9//1uJiYmOjgfApFwdHQC5a+3aterYsaNcXV3VpUsXhYWFKU+ePPr111+1atUqRUVFKS4uTsHBwXbPNmDAANWqVUuSdPnyZS1fvlwvvfSSrl69qr59+9o9jzMpUaKEIiMjJUkXL17UkiVL9K9//UtHjx7VhAkT7J5n48aNdl/nX1WrVk2vv/66JOnMmTOaO3eu2rdvr6ioKL366qsPnDc4OFg3b95U3rx57RE1Q1FRUSpQoICuX7+ujRs3avz48fr222+1Y8cOWSwWh+UCYFIGHlmxsbGGp6enUalSJePMmTPpxqekpBjTp083Tp06ZddcmzdvNiQZn332mc3w5ORko3jx4saTTz6ZI+tJS0szbty4kSPLsqcGDRoYVapUsRmWlJRklChRwvD09DRu377toGSOERwcbLRq1cpm2NmzZw1PT0+jfPny950vJSXFSE5OztK6IiIijODg4OzEzNDo0aMNScbFixdthrdv396QZOzcufNvLT87nzEjcXFxhiRj4cKFf3tZAHIfh00fYZMmTVJSUpIWLlyoYsWKpRvv6uqqAQMGqGTJktZhhw4dUvfu3VWmTBnly5dPAQEB6tmzpy5fvmydZvPmzbJYLBketlq2bJksFot27dqV5bxubm4qXLiwXF1tdwgvXLhQjRs3lp+fn9zd3VW5cmVFRUWlm79UqVJq3bq1NmzYoJo1a8rDw0Nz586VJEVHR+upp55SoUKFVKBAAVWoUEFvvfXWA/M89thjatSoUbrhaWlpKl68uF544QXrsE8//VQ1atSQl5eXChYsqNDQUE2fPj3L2+B+8ufPryeeeEJJSUm6ePGiTp48qT59+qhChQry8PCQr6+vXnzxRZ04ccJmvpSUFI0dO1blypVTvnz55Ovrq6eeekrR0dHWac6dO6cePXqoRIkScnd3V7FixdSmTRubZd17ztvdQ98rVqzQ+PHjVaJECeXLl09NmjRRbGxsuvyzZ89WmTJl5OHhodq1a+u77777W+fRBQQEqFKlSoqLi5P0/+ds/e///q+mTZumsmXLyt3dXT///PN9z+das2aNHnvsMeXLl0+PPfbYfQ/DpqWladq0aapSpYry5csnf39/9e7dW1euXMlWdklq3LixpD9Pabh9+7ZGjRqlGjVqyNvbW56enqpfv742b95sM8+DPmNmlyFJV69eVffu3eXt7a1ChQopIiJCV69ezTDnr7/+qhdeeEE+Pj7Kly+fatasqS+//NJmmsx8xwDkLA6bPsLWrl2rkJAQ1alTJ9PzREdH67ffflOPHj0UEBCgn376SR988IF++ukn7d69WxaLRQ0bNlTJkiW1dOlStWvXzmb+pUuXqmzZsqpbt+5D13Xt2jVdunRJkhQfH69ly5bpxx9/1IcffmgzXVRUlKpUqaLnnntOrq6u+uqrr9SnTx+lpaWlO7x65MgRde7cWb1799bLL7+sChUq6KefflLr1q1VtWpVvfPOO3J3d1dsbKx27NjxwHwdO3bUmDFjdO7cOQUEBFiHb9++XWfOnFGnTp2s26xz585q0qSJJk6cKEn65ZdftGPHDg0cOPCh2yGzfvvtN7m4uKhQoUL673//q507d6pTp04qUaKETpw4oaioKDVs2FA///yz8ufPL+nPc64iIyPVq1cv1a5dW4mJidq/f78OHjyoZ555RpL0/PPP66efflL//v1VqlQpXbhwQdHR0Tp16tRDT96fMGGC8uTJozfeeEMJCQmaNGmSunTpoj179liniYqKUr9+/VS/fn0NHjxYJ06cUNu2bVW4cGGVKFEiW9siJSVFp0+flq+vr83whQsX6tatW3rllVfk7u4uHx+fDM8T3Lhxo55//nlVrlxZkZGRunz5srXA3qt3795atGiRevTooQEDBiguLk6zZs3S999/rx07dmTrcOzx48clSb6+vkpMTNT8+fPVuXNnvfzyy7p27Zo+/PBDNW/eXHv37lW1atUe+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rueff15FixZ94LLOnj2rmJgYRUREyNvb2zr8mWeeUeXKlW2m/eyzz+Tt7a1nnnlGly5dsr5q1KihAgUKZHhYMiMVKlRQ0aJFVbp0afXu3VshISFat26d8ufPLxcXF+s2TEtLU3x8vO7cuaOaNWva/Cwf9Bkzu4z//ve/cnV11WuvvWYzb//+/W2WFx8fr2+//VYdOnSw7iG/dOmSLl++rObNm+vYsWP6448/JD38OwYg51HeHlFeXl6SpOvXr6cbN3fuXEVHR+vjjz9ONy4+Pl4DBw6Uv7+/PDw8rP/gSLIpShUrVlStWrVsbu2xdOlSPfHEEwoJCclUxtDQUDVt2lRNmzZVhw4d9PHHH6t169YaPny4Ll68aJ1
2023-04-13 09:42:51 +00:00
"text/plain": [
"<Figure size 642.986x500 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"gaydflightparade = gaydflight3[gaydflight3['pride parade index'] != 0]\n",
"\n",
"gaydflightnoparade = gaydflight3[gaydflight3['pride parade index'] != 1]\n",
"\n",
"g = sns.catplot(\n",
" data=gaydflight3, kind=\"bar\",\n",
" x='gay bars index', y='gay bars index', hue='pride parade index'\n",
2023-04-13 18:37:53 +00:00
")\n",
"\n",
"g.set(xlabel=\"Gay Bars\", ylabel=\"Gay Bars\", title=\"Gay Bars vs. Passing Pride Parades\")"
2023-04-13 09:42:51 +00:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"the above shows that my hypothesis 'more gay bars <==> more pride parades' should be rejected\n",
"\n",
"against my expectation, more gay bars are located in regions pride parades don't pass through\n",
"\n",
"the obvious explanation I can see is each community has a constant amount of queer activity such that more queer people exist such that the communities with more of A have less B\n",
"\n",
"alternatively this correlation should be discarded due to the fact that it exists mostly in zip areas with more then 10 bars\n",
"\n",
"a final explanation would be to cite the sampling bias, which while isn't as extreme as the tax DF from the other research question, is still big enough of a sampling bias to disregard the results"
2023-03-07 08:41:48 +00:00
]
2023-02-01 01:23:45 +00:00
}
],
"metadata": {
2023-02-16 00:29:26 +00:00
"kernelspec": {
2023-04-13 18:37:53 +00:00
"display_name": "Python 3 (ipykernel)",
2023-02-16 00:29:26 +00:00
"language": "python",
"name": "python3"
},
2023-02-01 01:23:45 +00:00
"language_info": {
2023-02-16 00:29:26 +00:00
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
2023-04-13 18:37:53 +00:00
"version": "3.10.10"
2023-03-03 08:51:14 +00:00
},
"vscode": {
"interpreter": {
"hash": "b2baa059f790e7ad780c83135aaea020c73a7a7a6921010b599b8b664933698d"
}
2023-02-01 01:23:45 +00:00
}
},
"nbformat": 4,
2023-02-16 00:29:26 +00:00
"nbformat_minor": 4
}