pride-data-analysis/analysis/analysis2.ipynb

896 lines
493 KiB
Plaintext
Raw Normal View History

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",
"**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",
"- 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",
"**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",
"- 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",
"execution_count": 1,
"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]"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import pandas as pd\n",
"import seaborn as sns\n",
"import numpy as np\n",
2023-02-16 00:29:26 +00:00
"\n",
"gaybourhoods = pd.read_csv(\"../data/raw/gaybourhoods.csv\")\n",
"gaybourhoods.head(5)"
2023-02-16 00:29:26 +00:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Data wrangling"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"ename": "FileNotFoundError",
"evalue": "[Errno 2] No such file or directory: '../data/raw/irs_2015.csv'",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mFileNotFoundError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[1;32mIn[2], line 5\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[39m# NOTE: This cell will not work unless this file is in the repository. The source\u001b[39;00m\n\u001b[0;32m 2\u001b[0m \u001b[39m# can be found linked in the references section of the readme, however, it is too\u001b[39;00m\n\u001b[0;32m 3\u001b[0m \u001b[39m# big for GitHub to handle.\u001b[39;00m\n\u001b[1;32m----> 5\u001b[0m irs \u001b[39m=\u001b[39m pd\u001b[39m.\u001b[39;49mread_csv(\u001b[39m\"\u001b[39;49m\u001b[39m../data/raw/irs_2015.csv\u001b[39;49m\u001b[39m\"\u001b[39;49m)\n\u001b[0;32m 7\u001b[0m \u001b[39m# Naively splitting the IRS data set in two. More formal data wrangling will\u001b[39;00m\n\u001b[0;32m 8\u001b[0m \u001b[39m# come later\u001b[39;00m\n\u001b[0;32m 9\u001b[0m irs1 \u001b[39m=\u001b[39m irs\u001b[39m.\u001b[39mhead(\u001b[39mint\u001b[39m(irs\u001b[39m.\u001b[39mshape[\u001b[39m0\u001b[39m] \u001b[39m/\u001b[39m \u001b[39m2\u001b[39m))\n",
"File \u001b[1;32mc:\\Users\\samia\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\pandas\\util\\_decorators.py:211\u001b[0m, in \u001b[0;36mdeprecate_kwarg.<locals>._deprecate_kwarg.<locals>.wrapper\u001b[1;34m(*args, **kwargs)\u001b[0m\n\u001b[0;32m 209\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[0;32m 210\u001b[0m kwargs[new_arg_name] \u001b[39m=\u001b[39m new_arg_value\n\u001b[1;32m--> 211\u001b[0m \u001b[39mreturn\u001b[39;00m func(\u001b[39m*\u001b[39;49margs, \u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49mkwargs)\n",
"File \u001b[1;32mc:\\Users\\samia\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\pandas\\util\\_decorators.py:331\u001b[0m, in \u001b[0;36mdeprecate_nonkeyword_arguments.<locals>.decorate.<locals>.wrapper\u001b[1;34m(*args, **kwargs)\u001b[0m\n\u001b[0;32m 325\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mlen\u001b[39m(args) \u001b[39m>\u001b[39m num_allow_args:\n\u001b[0;32m 326\u001b[0m warnings\u001b[39m.\u001b[39mwarn(\n\u001b[0;32m 327\u001b[0m msg\u001b[39m.\u001b[39mformat(arguments\u001b[39m=\u001b[39m_format_argument_list(allow_args)),\n\u001b[0;32m 328\u001b[0m \u001b[39mFutureWarning\u001b[39;00m,\n\u001b[0;32m 329\u001b[0m stacklevel\u001b[39m=\u001b[39mfind_stack_level(),\n\u001b[0;32m 330\u001b[0m )\n\u001b[1;32m--> 331\u001b[0m \u001b[39mreturn\u001b[39;00m func(\u001b[39m*\u001b[39;49margs, \u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49mkwargs)\n",
"File \u001b[1;32mc:\\Users\\samia\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\pandas\\io\\parsers\\readers.py:950\u001b[0m, in \u001b[0;36mread_csv\u001b[1;34m(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, squeeze, prefix, mangle_dupe_cols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, skipfooter, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, dayfirst, cache_dates, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, doublequote, escapechar, comment, encoding, encoding_errors, dialect, error_bad_lines, warn_bad_lines, on_bad_lines, delim_whitespace, low_memory, memory_map, float_precision, storage_options)\u001b[0m\n\u001b[0;32m 935\u001b[0m kwds_defaults \u001b[39m=\u001b[39m _refine_defaults_read(\n\u001b[0;32m 936\u001b[0m dialect,\n\u001b[0;32m 937\u001b[0m delimiter,\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 946\u001b[0m defaults\u001b[39m=\u001b[39m{\u001b[39m\"\u001b[39m\u001b[39mdelimiter\u001b[39m\u001b[39m\"\u001b[39m: \u001b[39m\"\u001b[39m\u001b[39m,\u001b[39m\u001b[39m\"\u001b[39m},\n\u001b[0;32m 947\u001b[0m )\n\u001b[0;32m 948\u001b[0m kwds\u001b[39m.\u001b[39mupdate(kwds_defaults)\n\u001b[1;32m--> 950\u001b[0m \u001b[39mreturn\u001b[39;00m _read(filepath_or_buffer, kwds)\n",
"File \u001b[1;32mc:\\Users\\samia\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\pandas\\io\\parsers\\readers.py:605\u001b[0m, in \u001b[0;36m_read\u001b[1;34m(filepath_or_buffer, kwds)\u001b[0m\n\u001b[0;32m 602\u001b[0m _validate_names(kwds\u001b[39m.\u001b[39mget(\u001b[39m\"\u001b[39m\u001b[39mnames\u001b[39m\u001b[39m\"\u001b[39m, \u001b[39mNone\u001b[39;00m))\n\u001b[0;32m 604\u001b[0m \u001b[39m# Create the parser.\u001b[39;00m\n\u001b[1;32m--> 605\u001b[0m parser \u001b[39m=\u001b[39m TextFileReader(filepath_or_buffer, \u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49mkwds)\n\u001b[0;32m 607\u001b[0m \u001b[39mif\u001b[39;00m chunksize \u001b[39mor\u001b[39;00m iterator:\n\u001b[0;32m 608\u001b[0m \u001b[39mreturn\u001b[39;00m parser\n",
"File \u001b[1;32mc:\\Users\\samia\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\pandas\\io\\parsers\\readers.py:1442\u001b[0m, in \u001b[0;36mTextFileReader.__init__\u001b[1;34m(self, f, engine, **kwds)\u001b[0m\n\u001b[0;32m 1439\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39moptions[\u001b[39m\"\u001b[39m\u001b[39mhas_index_names\u001b[39m\u001b[39m\"\u001b[39m] \u001b[39m=\u001b[39m kwds[\u001b[39m\"\u001b[39m\u001b[39mhas_index_names\u001b[39m\u001b[39m\"\u001b[39m]\n\u001b[0;32m 1441\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mhandles: IOHandles \u001b[39m|\u001b[39m \u001b[39mNone\u001b[39;00m \u001b[39m=\u001b[39m \u001b[39mNone\u001b[39;00m\n\u001b[1;32m-> 1442\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_engine \u001b[39m=\u001b[39m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_make_engine(f, \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mengine)\n",
"File \u001b[1;32mc:\\Users\\samia\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\pandas\\io\\parsers\\readers.py:1735\u001b[0m, in \u001b[0;36mTextFileReader._make_engine\u001b[1;34m(self, f, engine)\u001b[0m\n\u001b[0;32m 1733\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39m\"\u001b[39m\u001b[39mb\u001b[39m\u001b[39m\"\u001b[39m \u001b[39mnot\u001b[39;00m \u001b[39min\u001b[39;00m mode:\n\u001b[0;32m 1734\u001b[0m mode \u001b[39m+\u001b[39m\u001b[39m=\u001b[39m \u001b[39m\"\u001b[39m\u001b[39mb\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[1;32m-> 1735\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mhandles \u001b[39m=\u001b[39m get_handle(\n\u001b[0;32m 1736\u001b[0m f,\n\u001b[0;32m 1737\u001b[0m mode,\n\u001b[0;32m 1738\u001b[0m encoding\u001b[39m=\u001b[39;49m\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49moptions\u001b[39m.\u001b[39;49mget(\u001b[39m\"\u001b[39;49m\u001b[39mencoding\u001b[39;49m\u001b[39m\"\u001b[39;49m, \u001b[39mNone\u001b[39;49;00m),\n\u001b[0;32m 1739\u001b[0m compression\u001b[39m=\u001b[39;49m\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49moptions\u001b[39m.\u001b[39;49mget(\u001b[39m\"\u001b[39;49m\u001b[39mcompression\u001b[39;49m\u001b[39m\"\u001b[39;49m, \u001b[39mNone\u001b[39;49;00m),\n\u001b[0;32m 1740\u001b[0m memory_map\u001b[39m=\u001b[39;49m\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49moptions\u001b[39m.\u001b[39;49mget(\u001b[39m\"\u001b[39;49m\u001b[39mmemory_map\u001b[39;49m\u001b[39m\"\u001b[39;49m, \u001b[39mFalse\u001b[39;49;00m),\n\u001b[0;32m 1741\u001b[0m is_text\u001b[39m=\u001b[39;49mis_text,\n\u001b[0;32m 1742\u001b[0m errors\u001b[39m=\u001b[39;49m\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49moptions\u001b[39m.\u001b[39;49mget(\u001b[39m\"\u001b[39;49m\u001b[39mencoding_errors\u001b[39;49m\u001b[39m\"\u001b[39;49m, \u001b[39m\"\u001b[39;49m\u001b[39mstrict\u001b[39;49m\u001b[39m\"\u001b[39;49m),\n\u001b[0;32m 1743\u001b[0m storage_options\u001b[39m=\u001b[39;49m\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49moptions\u001b[39m.\u001b[39;49mget(\u001b[39m\"\u001b[39;49m\u001b[39mstorage_options\u001b[39;49m\u001b[39m\"\u001b[39;49m, \u001b[39mNone\u001b[39;49;00m),\n\u001b[0;32m 1744\u001b[0m )\n\u001b[0;32m 1745\u001b[0m \u001b[39massert\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mhandles \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m\n\u001b[0;32m 1746\u001b[0m f \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mhandles\u001b[39m.\u001b[39mhandle\n",
"File \u001b[1;32mc:\\Users\\samia\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\pandas\\io\\common.py:856\u001b[0m, in \u001b[0;36mget_handle\u001b[1;34m(path_or_buf, mode, encoding, compression, memory_map, is_text, errors, storage_options)\u001b[0m\n\u001b[0;32m 851\u001b[0m \u001b[39melif\u001b[39;00m \u001b[39misinstance\u001b[39m(handle, \u001b[39mstr\u001b[39m):\n\u001b[0;32m 852\u001b[0m \u001b[39m# Check whether the filename is to be opened in binary mode.\u001b[39;00m\n\u001b[0;32m 853\u001b[0m \u001b[39m# Binary mode does not support 'encoding' and 'newline'.\u001b[39;00m\n\u001b[0;32m 854\u001b[0m \u001b[39mif\u001b[39;00m ioargs\u001b[39m.\u001b[39mencoding \u001b[39mand\u001b[39;00m \u001b[39m\"\u001b[39m\u001b[39mb\u001b[39m\u001b[39m\"\u001b[39m \u001b[39mnot\u001b[39;00m \u001b[39min\u001b[39;00m ioargs\u001b[39m.\u001b[39mmode:\n\u001b[0;32m 855\u001b[0m \u001b[39m# Encoding\u001b[39;00m\n\u001b[1;32m--> 856\u001b[0m handle \u001b[39m=\u001b[39m \u001b[39mopen\u001b[39;49m(\n\u001b[0;32m 857\u001b[0m handle,\n\u001b[0;32m 858\u001b[0m ioargs\u001b[39m.\u001b[39;49mmode,\n\u001b[0;32m 859\u001b[0m encoding\u001b[39m=\u001b[39;49mioargs\u001b[39m.\u001b[39;49mencoding,\n\u001b[0;32m 860\u001b[0m errors\u001b[39m=\u001b[39;49merrors,\n\u001b[0;32m 861\u001b[0m newline\u001b[39m=\u001b[39;49m\u001b[39m\"\u001b[39;49m\u001b[39m\"\u001b[39;49m,\n\u001b[0;32m 862\u001b[0m )\n\u001b[0;32m 863\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[0;32m 864\u001b[0m \u001b[39m# Binary mode\u001b[39;00m\n\u001b[0;32m 865\u001b[0m handle \u001b[39m=\u001b[39m \u001b[39mopen\u001b[39m(handle, ioargs\u001b[39m.\u001b[39mmode)\n",
"\u001b[1;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: '../data/raw/irs_2015.csv'"
]
}
],
"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",
"\n",
"irs = pd.read_csv(\"../data/raw/irs_2015.csv\")\n",
"\n",
"# Naively splitting the IRS data set in two. More formal data wrangling will\n",
"# come later\n",
"irs1 = irs.head(int(irs.shape[0] / 2))\n",
"irs2 = irs.tail(int(irs.shape[0] / 2))\n",
"\n",
"irs1.to_csv(\"../data/processed/irs_2015_1\", index=False)\n",
"irs2.to_csv(\"../data/processed/irs_2015_2\", index=False)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"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",
"# 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",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" 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\n",
" zip population income overall tax paid\n",
"0 0 1356760.0 1 48150.0\n",
"1 0 1010990.0 2 107304.0\n",
"2 0 583910.0 3 139598.0\n",
"3 0 423990.0 4 128823.0\n",
"4 0 589490.0 5 421004.0\n",
"... ... ... ... ...\n",
"166693 99999 6660.0 2 869.0\n",
"166694 99999 5440.0 3 1273.0\n",
"166695 99999 4780.0 4 1635.0\n",
"166696 99999 6930.0 5 5576.0\n",
"166697 99999 1890.0 6 14487.0\n",
"\n",
"[166698 rows x 4 columns]\n"
]
}
],
"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",
"print(taxdf.describe())\n",
"print(taxdf)\n",
"# print(irs.columns)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" 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\n",
" zip gay tax rate\n",
"0 90069 2120\n",
"1 94114 5080\n",
"2 10011 5790\n",
"3 10014 3510\n",
"4 94103 2660\n",
"... ... ...\n",
"2323 97208 0\n",
"2324 98154 0\n",
"2325 98158 0\n",
"2326 98174 0\n",
"2327 98195 0\n",
"\n",
"[2328 rows x 2 columns]\n"
]
}
],
"source": [
"#wrangle gay\n",
"gaydf = pd.DataFrame(zip(gaybourhoods['GEOID10'], gaybourhoods['Tax_Mjoint']))\n",
"gaydf.columns=(('zip', 'gay tax rate'))\n",
"\n",
"print(gaydf.describe())\n",
"print(gaydf)\n",
"\n",
"# gaybourhoods.columns"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" 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",
" 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]\n"
]
}
],
"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",
"print(df2.describe())\n",
"print(\"------------------------------------------------------------------------\")\n",
"print(df2)\n",
"\n",
"df2.to_csv(\"../data/processed/tax_and_gay.csv\")\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 56,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" 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 \n",
"------------------------------------------------------------------------\n",
" 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",
"\n",
" 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]\n"
]
}
],
"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",
"print(gaydf.describe())\n",
"print(\"------------------------------------------------------------------------\")\n",
"print(gaydf)"
]
},
{
"cell_type": "code",
"execution_count": 51,
"metadata": {},
"outputs": [
{
"data": {
"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+JwtW7awdOlSrrrqKoqLi7PbR44cyXnnnceLL77Y5XWLSPdQkBGRHq2iooK8vLwO24499liAvY5l2bhxIwDHHXfcbvuGDBlCU1MT7e3tnVuoiOSEgoyIiIhYloKMiHQbwzAO+jmbN2/erffkgw8+AODoo4/e43MGDhwIwNq1a3fbt2bNGkpLS7O9PIdSk4j0HAoyItJtdoWHg1l8LpVK8dhjj2UfJxIJHnvsMfr06cNJJ520x+eUl5dzwgkn8PTTT3f4XStXruT//u//mDhx4mHVJCI9h6Zfi0i32RU87rjjDr785S/jdDqZNGnSbmNgPq2iooIf/vCHfPTRRxx77LH8/ve/Z+nSpTz++OM4nc69Pu/BBx/kggsuYPTo0Vx99dXZ6deBQIB77rnnsGoSkR4k19OmROTIcu+995pHHXWUabPZ9jvt+ayzzjKHDRtm/utf/zJHjx5tejwec+DAgebs2bM7HLen6demaZqvvvqqOWbMGNPr9Zp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DWyxJgcdJJJmin99LU3uMmZ8fTiSZoj2exmEzmF/XxG/+sZFragfx6vvbqK0p5Z0Pm+nr92gqtoiISCdRj8xB6uf3EE2kSaYzeBwOmttjeJ0O7DZY+XGI9niKxrY4I44KcN6QvsRTaZbUt3LPpGE8OX8DbTFdXhIREeksPSbIPPDAAxiGwc0335zdNm7cOAzD6PBz3XXX5a5IdvbK9C/yYbJzTRmf28kFP5/PxJ/P5+PWKIZhkO9xUOZ3M7jcT5nfw3fOP46XVm0hkkhT4HHmtH4REZHepEdcWlq0aBGPPfYYI0eO3G3f17/+dWbOnJl97PP5urO0Pepf7KOhuZ3/fucjrhozkNqaUuata2L263UdjqutLuW+S4ZT3xzhF2+s58yaUkrzdVlJRESks+S8RyYcDvOVr3yFX/7ylxQVFe223+fz0a9fv+yP3+/PQZW7swF3TBzCU/M/Yuq
"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
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#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"
]
},
{
"cell_type": "code",
"execution_count": 59,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjIAAAHHCAYAAACle7JuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/P9b71AAAACXBIWXMAAA9hAAAPYQGoP6dpAAB930lEQVR4nOzdeXwU5f3A8c/M7JlNNvcJIdz3pSgYRTxAU0Wr9cKjFRWlWrytV7WKtv609lBbK1XbirZaFVutJ4oH4oGIyC0gR7hzATn33pnn90fM1iUJZ8Im4ft+vfb1ys48O/OdJ5vdb555Dk0ppRBCCCGE6IT0RAcghBBCCHGgJJERQgghRKcliYwQQgghOi1JZIQQQgjRaUkiI4QQQohOSxIZIYQQQnRaksgIIYQQotOSREYIIYQQnZYkMkIIIYTotCSREWI306dPR9O0fSqraRrTp0/fY5m5c+eiaRqvvPJKG0QnROsuu+wyevbsuU9l9+d93lb2J76D1bNnT84444xDci6RWJLIHGY0Tdunx9y5cxMdqjhAn332GT/60Y/Izc3F6XTSs2dPrr76arZs2ZLo0MQh5vf7mT59epf9e/7mm2+YPn06GzduTFgMe0qYvvrqKzRNY+bMmXHbP/30U0477TS6deuGy+WiR48enHnmmbzwwguHIOKux5boAMSh9Y9//CPu+XPPPcecOXOabR80aNChDKtDufvuu7njjjsSHcYB+dOf/sQNN9xA7969ue6668jPz2fVqlX89a9/5aWXXuKdd97hmGOOSXSYop08/fTTWJYVe+73+7nvvvsAOPHEE+PKJuJ9vnt8B+ubb77hvvvu48QTTzxkLT0Ha9asWUyaNImRI0dyww03kJ6eTmlpKfPmzePpp5/m4osvTnSInY4kMoeZH//4x3HPv/jiC+bMmdNs++HMZrNhs3W+P43PPvuMG2+8kbFjxzJ79mySkpJi+6655hqOO+44zj33XFauXElaWlriAt0Dn8+Hx+NJdBidlt1u3+eyiXif7098XdX06dMZPHgwX3zxBQ6HI25fZWVlgqLq3OTWkmjmmWee4eSTTyYnJwen08ngwYOZMWNGXJkPP/wQXde555574ra/8MILaJoWV37btm1cccUVsVsdQ4YM4e9//3uz8/7pT39iyJAhJCUlkZ6ezlFHHbXXptam/icvvfQSv/jFL8jLy8Pj8fDDH/6w2a2UTz75hPPPP58ePXrgdDopLCzkpptuIhAIxJVrqe9AKBTipptuIjs7m5SUFH74wx+ydevWPca2O9M09xjjvffei91up6qqqtlrp06dSlpaGsFgsNXj/+pXv0LTNJ599tm4JAagT58+PPzww2zfvp2nnnoqtv3EE09s9p86tNyXwbIsHn30UYYMGYL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2Pb//ve/ClBvvPHGHo83a9asVv82ioqKFKDmzZsX21ZZWamcTqe65ZZbYtt+9atfKY/Ho7799tu4199xxx3KMAy1efPmPcZQVFSkJk6c2OK+hQsXKkA988wzsW1/+9vfFKAcDoc66aST1C9/+Uv1ySefxN6bYv/JrSXRTFMLBkBtbS07duzghBNOYMOGDXFNx0lJScycOZNVq1Yxbtw43nrrLR555BF69OgBgFKKf//735x55pkopdixY0fsUVJSQm1tLV9//TUAaWlpbN26da/Nya259NJLSUlJiT0/77zzyM/P5+23327xunw+Hzt27ODYY49FKcXixYtbPXbTMa6//vq47U2tSW0Z46WXXsqCBQtYv359bNvzzz9PYWEhJ5xwQqvHrq+vB4g7fktSUlJiZffHrFmzSE1N5ZRTTon7PY4aNYr
"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",
"_ = plot2.set(xlabel=\"Long\", ylabel=\"Lat\", title=\"Taxes paid by Queer communities in the US\")\n"
]
},
{
"cell_type": "code",
"execution_count": 57,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjIAAAHHCAYAAACle7JuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/P9b71AAAACXBIWXMAAA9hAAAPYQGoP6dpAAB4i0lEQVR4nO3dd5wddb3/8dfMnLrlbC8pSyqkAKGX0JGQoAEp0QdIDQYQDF0woFwQlAuCKCCCgNKuyQ8UxSsCwdCvGCAGEgIJAdJJsrtp20+d+f7+WHLMIbupuzl7Nu/n47GPx+53vmfmM3PaZ7/zLZYxxiAiIiKSg+xsByAiIiKyo5TIiIiISM5SIiMiIiI5S4mMiIiI5CwlMiIiIpKzlMiIiIhIzlIiIyIiIjlLiYyIiIjkLCUyIiIikrOUyIgAP/nJT7Asa5vqWpbFT37yky3WeeONN7Asi2effbYLousZJk6cyMCBA7tt/8cddxzHHXdct+1/d7F06VIsy+KJJ57Ypvrb8nruStsb38544oknsCyLf//7391+LMkeJTK7AcuytunnjTfeyHaosp1efPHFXfolJLmpt79OHnzwwV2SGHVmawnTySefvNk/AS0tLdxyyy3ss88+5OfnU1ZWxv77789VV13FqlWrdkHUvYcv2wFI9/uf//mfjL+feuopZsyYsVn5iBEjdmVYPcpNN93EDTfckO0wttuLL77Ib37zm13yJfXoo4/ieV63H0d2zoABA4hGo/j9/nTZll4n0WgUn2/XfRV0FN/OevDBBykvL2fixIldts/ulEwmOeaYY/jkk0+44IILuOKKK2hpaeHjjz9m2rRpnH766fTt2zfbYeYMJTK7gXPPPTfj73feeYcZM2ZsVr478/l8u/TDPBd15RePdB/LsgiFQttcf3vqdoXtja83+utf/8oHH3zA1KlTOfvsszO2xWIxEolEliLLTbq1JAA8/vjjfO1rX6OyspJgMMjIkSN56KGHMuq89tpr2LbNzTffnFE+bdo0LMvKqL9y5Uq++93vUlVVRTAYZO+99+axxx7b7Li//vWv2XvvvcnLy6OkpISDDz6YadOmbTHWjf1PnnnmGX70ox9RXV1Nfn4+3/zmN1mxYkVG3f/7v//j29/+NnvssQfBYJCamhquueYaotFoRr2O+sjE43GuueYaKioqKCws5Jvf/CZffPHFFmP7Ktd1txjjLbfcgt/vZ82aNZs99pJLLqG4uJhYLNbhvidOnMhvfvMbIPP2oTGGgQMHcuqpp272mFgsRlFREd/73veA7buWHfWR8TyP++67j3333ZdQKERFRQUnnXRSRhP7try2ttcf/vAHDj300PTr5phjjuEf//hHRp0HH3yQvffem2AwSN++fZk8eTINDQ0ZdY477jj22WcfPvzwQ4499ljy8vIYOnRoum/Tm2++yWGHHUY4HGbYsGG88sorGY/f+Lr59NNPOffccykqKqKiooL/+q//whjDihUrOPXUU4lEIlRXV3PPPfdkPH7jLYmlS5dmlG98Xja93bsx1vnz53P88ceTl5dHv379uOuuuzIe+9U+KJ29TjbqqI9Md75/O+ojM3HiRAoKCli5ciWnnXYaBQUFVFRUcN111+G67hb3N3DgQD7++GPefPPN9Ll9ta9VPB7n2muvpaKigvz8fE4//fQO33MvvfQSRx99NPn5+RQWFjJ+/Hg+/vjjLR5/RyxatAiAI488crNtoVCISCTS5cfszZTICAAPPfQQAwYM4Ec/+hH33HMPNTU1fP/7309/AAJ87Wtf4/vf/z533HEH77//PgCrV6/miiuuYMyYMVx66aUA1NXVcfjhh/PKK69w+eWXc9999zF06FAmTZrEvffem97fo48+ypVXXsnIkSO59957ufXWW9l///159913tynm22+/nRdeeIEpU6Zw5ZVXMmPGDMaMGZORpPzpT3+ira2Nyy67jF//+teMGzeOX//615x//vlb3f9FF13Evffey9ixY7nzzjvx+/2MHz9+m2Lb1hjPO+88UqkUzzzzTMbjEokEzz77LBMmTOj0v9fvfe97nHjiiUD77cONP5Zlce655/LSSy+xfv36jMc8//zzNDU1bdYaty3XsiOTJk3i6quvpqamhp///OfccMMNhEIh3nnnnXSdbXltbY9bb72V8847D7/fz2233catt95KTU0Nr732WrrOT37yEyZPnkzfvn255557mDBhAg8//DBjx44lmUxm7G/Dhg2cfPLJHHbYYdx1110Eg0HOOussnnnmGc466yy+8Y1vcOedd9La2sq3vvUtmpubN4vpzDPPxPM87rzzTg477DB+9rOfce+993LiiSfSr18/fv7znzN06FCuu+463nrrrR06742xnnTSSey3337cc889DB8+nClTpvDSSy91+pjOXied2VXv369yXZdx48ZRVlbGL37xC4499ljuueceHnnkkS0+7t5776V///4MHz48fW4//vGPM+pcccUVzJ07l1tuuYXLLruM559/nssvvzyjzv/8z/8wfvx4CgoK+PnPf85//dd/MX/+fI466qjNEs2dNWDAAKD9Nr8xpkv3vVsystuZPHmy+epT39bWtlm9cePGmcGDB2eUtba2mqFDh5q9997bxGIxM378eBOJRMyyZcvSdSZNmmT69Olj1q5dm/HYs846yxQVFaWPdeqpp5q99957u+N//fXXDWD69etnmpqa0uV//OMfDWDuu+++LZ7XHXfcYSzLyoj5lltuybgmc+bMMYD5/ve/n/HYs88+2wDmlltu6bIYR48ebQ477LCMx//lL38xgHn99de3eJyOnktjjFm4cKEBzEMPPZRR/s1vftMMHDjQeJ633XFecMEFZsCAAem/X3vtNQOYK6+8crPjb9y/Mdv+2jr22GPNscceu8Xz/eyzz4xt2+b00083rut2eMz6+noTCATM2LFjM+o88MADBjCPPfZYxjEBM23atHTZJ598YgBj27Z555130uUvv/yyAczjjz+eLtv4urnkkkvSZalUyvTv399YlmXuvPPOdPmGDRtMOBw2F1xwQbrs8ccfN4BZsmRJxrlsfF42ff43xvrUU0+ly+LxuKmurjYTJkxIly1ZsmSzODt7nRhjNns9d/f7t6P4LrjgAgOY2267LaPuAQccYA466KCt7nPvvffu8LWz8fqOGTMm4zV5zTXXGMdxTENDgzHGmObmZlNcXGwuvvjijMfX1taaoqKizco7O86sWbM63D5+/PiM905bW5sZNmyYAcyAAQPMxIkTze9//3tTV1e31XOVzalFRgAIh8Pp3xsbG1m7di3HHnssixcvprGxMb0tLy+PJ554ggULFnDMMcfwwgsv8Ktf/Yo99tgDAGMMf/7znznllFMwxrB27dr0z7hx42hsbEy35hQXF/PFF18wa9asHYr5/PPPp7CwMP33t771Lfr06cOLL77Y4Xm1traydu1ajjjiCIwxfPDBB53ue+M+rrzyyozyq6++ustjPP/883n33XfTzc0AU6dOpaamhmOPPXa7jrfRXnvtxWGHHcbUqVPTZevXr+ell17inHPO2ew22rbE+VV//vOfsSyLW265ZbNtm+5/W19b2+Kvf/0rnudx8803Y9uZH18bj/nKK6+QSCS4+uqrM+pcfPHFRCIRXnjhhYzHFRQUcNZZZ6X/HjZsGMXFxYwYMYLDDjssXb7x98WLF28W10UXXZT+3XEcDj74YIwxTJo0KV1eXFzMsGHDOnz8tiooKMhoTQsEAhx66KE7tc9N7cr3b0c2tupudPTRR3fJuV1yySUZr8mjjz4a13VZtmwZADNmzKChoYHvfOc7GefsOA6HHXYYr7/++k7HsKlwOMy7777L9ddfD7TfYpw0aRJ9+vThiiuuIB6Pd+nxejslMgLA22+/zZgxY8jPz6e4uJiKigp+9KMfAWz2ZXPkkUdy2WWX8d577zFu3Di++93vpretWbOGhoYGHnnkESoqKjJ+LrzwQgDq6+sBmDJlCgUFBRx66KHsueeeTJ48mbfffnubY95zzz0z/rYsi6FDh2Y0Ay9fvpyJEydSWlq
"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",
"_ = plot2.set(xlabel=\"Long\", ylabel=\"Lat\", title=\"Taxes paid by typical communities in the US\")"
]
},
{
"cell_type": "code",
"execution_count": 64,
"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"
]
},
"execution_count": 64,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"gaydfhybridplot = pd.merge(gaydfgentaxplot, gaydfgaytaxplot)\n",
"\n",
"gaydfhybridplot.describe()\n"
]
},
{
"cell_type": "code",
"execution_count": 65,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<seaborn.axisgrid.PairGrid at 0x2d5984b7350>"
]
},
"execution_count": 65,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA9oAAAPaCAYAAABoFyBHAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/P9b71AAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOydeXxTVfr/P9nTdEnbhLJJoZAilLZQdmiLgiirAjKOoDM/oLiNgAujIMqOiugwiuIyKgh+B3CcUUBRURQXCqgsVSh7ASnaltIlSdssN9vvj/RestwkXZI0Lc/79fIlzT1JTpJ7nnOeXeBwOBwgCIIgCIIgCIIgCCIoCFt6AgRBEARBEARBEATRliBFmyAIgiAIgiAIgiCCCCnaBEEQBEEQBEEQBBFESNEmCIIgCIIgCIIgiCBCijZBEARBEARBEARBBBFStAmCIAiCIAiCIAgiiJCiTRAEQRAEQRAEQRBBhBRtgiAIgiAIgiAIgggipGgHCYfDAb1eD4fD0dJTIYjrFlqHBBEZ0FokiJaH1iFBtCykaAeJmpoaKJVK1NTUtPRUCOK6hdYhQUQGtBYJouWhdUgQLQsp2gRBEARBEARBEAQRRFpU0V69ejUGDRqE2NhYJCUlYfLkyThz5ozbmJtvvhkCgcDtv4ceeshtTHFxMSZMmACFQoGkpCQ8+eSTsFqtbmO+++479O/fHzKZDBqNBps2bfKaz+uvv45u3bpBLpdjyJAh+Pnnn4P+mQmCIAiCIAiCIIi2TYsq2t9//z3mzJmDH3/8EXv27IHFYsFtt92Guro6t3H3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 with 20 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"sns.pairplot(gaydfhybridplot)"
]
},
{
"cell_type": "code",
"execution_count": 66,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<seaborn.axisgrid.PairGrid at 0x2d5984b8a10>"
]
},
"execution_count": 66,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAfAAAAHwCAYAAABZrD3mAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/P9b71AAAACXBIWXMAAA9hAAAPYQGoP6dpAAC330lEQVR4nOzdeVyU9dr48c8MMMMm6whIgqCQ+4JZSoBtJi4tlk9Pmac0bRctbbXc0sqy1SXb1fo92nbKMvVYpqdcU1M64pooiR4FBGFGGGBgZn5/4NwyMAygjGzX+/XidZy5v3Pf93Aarvlu16WyWq1WhBBCCNGsqBv7BoQQQghRfxLAhRBCiGZIArgQQgjRDEkAF0IIIZohCeBCCCFEMyQBXAghhGiGJIALIYQQzZAEcCGEEKIZkgDeQKxWKwaDAcmLI0T9yedHiPqTAN5Azp07h7+/P+fOnWvsWxGi2ZHPjxD1JwFcCCGEaIYaNYDPnTuXq6++mjZt2hASEsKIESM4fPiwXZvrr78elUpl9/Poo4/atcnMzGT48OF4e3sTEhLCM888Q3l5uV2bX3/9lb59+6LVaomJiWHZsmXV7ue9994jKioKT09P+vfvz86dOxv8PQshhBANoVED+G+//caECRP4/fffWb9+PWVlZQwePJiioiK7dg899BCnT59WfubNm6ccM5vNDB8+HJPJxLZt2/jss89YtmwZM2bMUNpkZGQwfPhwbrjhBv7880+efPJJHnzwQX766SelzVdffcWUKVOYOXMme/bsoXfv3iQnJ5OTk+P6X4QQQghRX9YmJCcnxwpYf/vtN+W56667zvrEE0/U+Jq1a9da1Wq1NSsrS3nu/ffft/r5+VlLS0utVqvV+uyzz1q7d+9u97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Wq1WprVlaW0ub999+3+vn5WUtLS61Wq9X67LPPWrt37253rbvvvtuanJysPL7mmmusEyZMUB6bzWZreHi4de7cuXW6d71ebwWser2+nu9aCCGfHyHqr0nNgev1egCCgoIA2L17N2VlZQwaNEhp06VLFyIjI9m+fTsA27dvp2fPnoSGhiptkpOTMRgM7N+/X2lT+Ry2NrZzmEwmdu/ebddGrVYzaNAgpU1VpaWlGAwGux8hRN3I50eIS9dkArjFYuHJJ58kISGBHj16AJCVlYVGoyEgIMCubWhoKFlZWUqbysHbdtx2zFkbg8FAcXExubm5mM1mh21s56hq7ty5+Pv7Kz8REREX98aFaIXk89N66Y0mjuYUkpqZz9EzhVJE5hI0mW1kEyZMYN++fWzZsqWxb6VOpk6dypQpU5THBoNB/ggJUUfy+WmdpJxrw2oSPfCUlBRWr17Nv//9b9q3b688HxYWhslkoqCgwK59dnY2YWFhSpuqq9Jtj2tr4+fnh5eXFzqdDjc3N4dtbOeoSqvV4ufnZ/cjhKgb+fy0PlLOteE1agC3Wq2kpKSwcuVKNm7cSHR0tN3xq666Cg8PDzZs2KA8d/jwYTIzM4mPjwcgPj6etLQ0u9Xi69evx8/Pj27duiltKp/D1sZ2Do1Gw1VXXWXXxmKxsGHDBqWNEEKIiyflXBteow6hT5gwgRUrVvDDDz/Qpk0bZb7Z398fLy8v/P39GT9+PFOmTCEoKAg/Pz8mTpxIfHw8AwYMAGDw4MF069aN++67j3nz5pGVlcW0adOYMGECWq0WgEcffZRFixbx7LPPMm7cODZu3MjXX3/NmjVrlHuZMmUKY8aMoV+/flxzzTW8++67FBUV8cADD1z+X4wQQrQwUs614TVqAH///fcBuP766+2eX7p0KWPHjgXgnXfeQa1WM3LkSEpLS0lOTmbx4sVKWzc3N1avXs1jjz1GfHw8Pj4+jBk
"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",
"\n",
"sns.pairplot(gaydflight)\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# 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\n",
"\n",
"# 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",
"\n",
"# due note that the analysis is severely limited by severe sampling bias as only hyper urban geographical stratum have been surveyed by gayborhoods"
]
2023-02-01 01:23:45 +00:00
}
],
"metadata": {
2023-02-16 00:29:26 +00:00
"kernelspec": {
"display_name": "Python 3",
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",
"version": "3.11.1"
},
"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
}