pride-data-analysis/analysis/analysis2.ipynb

1614 lines
811 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",
2023-04-13 09:42:51 +00:00
"execution_count": 10,
"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",
2023-04-09 00:25:46 +00:00
"execution_count": 6,
"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",
2023-04-09 00:25:46 +00:00
"execution_count": 7,
"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",
2023-04-13 09:42:51 +00:00
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjIAAAHHCAYAAACle7JuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/P9b71AAAACXBIWXMAAA9hAAAPYQGoP6dpAABOTklEQVR4nO3deXxU9b3/8deZfSbJTDYCiQSMJMquuCNEUVEqSkVtbyu9VcFW7XWpt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ca72JHOMGMi4dhYuK0GVT3yePGc2p2CzO11aVMHVvF6s1BHHYDgEQqo8tLIiIinUjTrw9CwOeivNBDWyxJgcdJJJmin99LU3uMmZ8fTiSZoj2exmEzmF/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",
2023-04-13 09:42:51 +00:00
"execution_count": null,
"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+ydevWPca2O9M09xjjvff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z7Y489pgC1fPny2Lbdf29VVVWtvkd3f59v3LhRGYahHnjggbhyy5cvVzabLbZ98eLFClCzZs1qdsy92T2+0tJSBajMzEy1a9eu2Pb//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",
2023-04-13 09:42:51 +00:00
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjIAAAHHCAYAAACle7JuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/P9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vfvMbIPP2oTGGgQMHcuqpp272mFgsRlFREd/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",
2023-04-13 09:42:51 +00:00
"execution_count": null,
"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",
2023-04-13 09:42:51 +00:00
"execution_count": null,
"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/79fIlzT1JTpJ7nnOeXeBwOBwgCIIgCIIgCIIgCCIoCFt6AgRBEARBEARBEATRliBFmyAIgiAIgiAIgiCCCCnaBEEQBEEQBEEQBBFESNEmCIIgCIIgCIIgiCBCijZBEARBEARBEARBBBFStAmCIAiCIAiCIAgiiJCiTRAEQRAEQRAEQRBBhBRtgiAIgiAIgiAIgggipGgHCYfDAb1eD4fD0dJTIYjrFlqHBBEZ0FokiJaH1iFBtCykaAeJmpoaKJVK1NTUtPRUCOK6hdYhQUQGtBYJouWhdUgQLQsp2gRBEARBEARBEAQRRFpU0V69ejUGDRqE2NhYJCUlYfLkyThz5ozbmJtvvhkCgcDtv4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OHjwIIYOHYovvvgCEydORElJCdq3bw8AeOutt7Bw4UJcvXoVUqkUCxcuxGeffYbCwkLuvaZNmwatVovdu3cDAIYMGYJBgwZh/fr1AAC73Y4uXbpg3rx5eOqppwLOnQp
"text/plain": [
"<Figure size 1000x1000 with 20 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"sns.pairplot(gaydfhybridplot)"
]
},
{
"cell_type": "code",
2023-04-13 09:42:51 +00:00
"execution_count": null,
"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/jss89YtmwZM2bM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LkSEpLS0lOTmbx4sVKWzc3N1avXs1jjz1GfHw8Pj4+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",
2023-04-13 09:42:51 +00:00
"# due note that the analysis is severely limited by severe sampling bias as only hyper urban geographical stratum have been surveyed by gayborhoods\n",
"\n"
]
},
{
"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 10:33:02 +00:00
"execution_count": 77,
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 10:33:02 +00:00
"execution_count": 77,
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 10:33:02 +00:00
"execution_count": 82,
2023-04-13 09:42:51 +00:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
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\n",
2023-04-13 09:42:51 +00:00
"------------------------------------------------------------------------\n",
2023-04-13 10:33:02 +00:00
" pride parade index gay bars index lat long\n",
"0 1 15 34.093828 -118.381697\n",
"1 0 17 37.758057 -122.435410\n",
"2 1 5 40.742039 -74.000620\n",
"3 1 10 40.734012 -74.006746\n",
"4 1 9 37.773134 -122.411167\n",
"... ... ... ... ...\n",
"2323 0 0 45.528666 -122.678981\n",
"2324 0 0 47.606211 -122.333792\n",
"2325 0 0 47.449678 -122.307657\n",
"2326 0 0 47.604569 -122.335359\n",
"2327 0 0 47.649339 -122.310294\n",
2023-04-13 09:42:51 +00:00
"\n",
2023-04-13 10:33:02 +00:00
"[2328 rows x 4 columns]\n"
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
"\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",
"# unperson unneccesary zip codes\n",
"# del gaydf['zip.1']\n",
"# del gaydf['ZIP']\n",
"\n",
"print(gaydf.describe())\n",
"print(\"------------------------------------------------------------------------\")\n",
"print(gaydf)\n",
"\n",
"gaydf.to_csv(\"../data/processed/gay_pride\", index=False)\n",
"\n",
"# gaybourhoods.columns"
]
},
{
"cell_type": "code",
2023-04-13 10:33:02 +00:00
"execution_count": 53,
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 10:33:02 +00:00
"execution_count": 54,
2023-04-13 09:42:51 +00:00
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjIAAAHHCAYAAACle7JuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/P9b71AAAACXBIWXMAAA9hAAAPYQGoP6dpAABp+UlEQVR4nO3dd3gU1f4G8He2901vpBBC71UJ0kSKiIpi+9kAG6hY0Styrw0btsu1otgAFcXeESwUEZAemhACBBLS626yvZzfH1z2upBAgCSbDe/nefbRnTk7+52TJ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Cz69etX7/tcdNFFAICXX345aPnRkYxx48adVv1nUlN9+vfvj9jYWLz11ltwu92B5QsWLDiu/6+++moUFBTgnXfeOW47DocDNpvtlN+/IRITE9G7d28sXLgw6PDfL7/8gr/++uu4Gn0+H5566qnjtuP1eoP2ac6cOVi7di3efvttPPXUUxg0aBDuuOMO3paDWgSOyBA1k4yMDDz99NOYOXMmDh48iMsuuwxGoxG5ubn4+uuvMWXKFDz44IPo3LkzMjIy8OCDD6KgoAAmkwlffvnlcXNlAAS+kO+55x6MGTMGcrkc//d//3fGtQ4aNAiRkZGYNGkS7rnnHkiShA8//LDeQxhJSUl4/vnncfDgQXTs2BGffvopsrKy8Pbbb5/w4m69evXCpEmT8PbbbwcOZ23YsAELFy7EZZddhvPPP/+09+F0a6qPUqnE008/jal
"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",
"_ = plot3.set(xlabel=\"long\", ylabel=\"lat\", title = \"heatmap of pride index\")\n"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"it seemed that most communities did not have a pride parade, but a number of them still did"
]
},
{
"cell_type": "code",
2023-04-13 10:33:02 +00:00
"execution_count": 55,
2023-04-13 09:42:51 +00:00
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjIAAAHHCAYAAACle7JuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/P9b71AAAACXBIWXMAAA9hAAAPYQGoP6dpAABuo0lEQVR4nO3dd5xU1f0//tetU3e2V7YAC1JEUCHq2rCgiGhssUfAGhULEg2Sj1+VGHtijA1LDFgw5meiiUlUYgFLREUQwYZ0lrIs26fPLef3x8DouLu4w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GrX/0qqe1vf/tbIUmSOPfcc8Vjjz0mZs2aJQoKCkT//v1Fc3Nzot21114rTj75ZHHXXXeJJ554Qlx66aVCURTxs5/9LNHmww8/FCeccIIAIJ577rnEQwgh1q1bJwCIAw88UAwfPlw88MAD4pZbbhG6rovDDjtM/PrXvxaHH364eOihh8R1110nJEkSF198cVKtp59+ujjnnHPE/fffL2bPni3OPvtsAUDceOONSe3Gjh0rysrKRFFRkbjmmmvEQw89JI488kgBQDz99NM/evwmT54sAIif/exn4tFHHxWTJk0SAMTpp5+eaPPcc8+Jo446SjgcjsT7XLNmTafbfOyxxwQAcdRRR4mHHnpITJ8+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//R79YAQgA4tNPP00s27Bhg3A6ne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kCFJz1etWgUAOO6449r9H/jvf/+b9H8AAI444ghcddVV+OSTTzB+/Hhccskle/w+iDqi/ngTon3HD/8y3kkIASD+F78kSXj99dc7bOv1egEAlmXhhBNOQFNTE2bMmIGhQ4fC4/Fg8+bNmDJlSqcDKHenph+rtaWlBWPHjoXP58NvfvMbVFdXw+l0YunSpZgxY8Zu1dAV6bpS5vnnn8eUKVNw+umn46abbkJRUREURcHdd9+NNWvWJLU977zzcMMNN2DevHn49a9/jeeffx5jxoxp92W9N6699lrMmTMH06ZNQ01NDbKzsyFJEs4777wOj/n3e3B2Ouecc3DUUUfhlVdewX//+1/cf//9uPfee/Hyyy9jwoQJu13Tj/2u7I6d7+G5555DSUlJu/Xf70EDgGg0ioULFwIA1qx
"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\")"
]
},
{
"attachments": {},
"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 10:33:02 +00:00
"execution_count": 56,
2023-04-13 09:42:51 +00:00
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAkoAAAGwCAYAAABWwkp7AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/P9b71AAAACXBIWXMAAA9hAAAPYQGoP6dpAAAuTklEQVR4nO3de1xVdb7/8fdGuXgDVORWiJdS0ZRMk6i0UkZQM508pWWmE3bxQGU0jvk45q2ZLC11chidppTpjKZ1TlmpR0O8pngJJS8po4ViKVgqIK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Pm+59AgAAkOpYUPrhhx908uRJBQUFSZIiIyOVm5urtLQ0e83atWtVVlamiIgIe83GjRtVUlJir0lOTlb79u3VtGnTa7sDAACgTnFqUCooKFB6errS09MlSZmZmUpPT1dWVpYKCgo0btw4bd26VYcPH1ZKSooGDRqkW265RdHR0ZKksLAwxcTE6Omnn9b27du1efNmxcfHa9iwYQoODpYkPf744/Lw8FBsbKz27dunpUuX6s9//rMSEhKctdsAAKCOcGpQ+vrrr9W1a1d17dpVkpSQkKCuXbtq0qRJqlevnnbv3q2HHnpI7dq1U2xsrLp166ZNmzY53D+0aNEidejQQX369FH//v117733OnxGko+Pj7788ktlZmaqW7duevnllzVp0iTjRwMAAACUc+rN3Pfff78syzKuX7169WXHaNasmRYvXlxpTZcuXbR
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plot5 = sns.histplot(gaydfgaybarsplot[\"gay bars index\"])"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"looks like the hypothesis was right - most communities with gay bars had multiple"
]
},
{
"cell_type": "code",
2023-04-13 10:33:02 +00:00
"execution_count": 57,
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 10:33:02 +00:00
"execution_count": 57,
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 10:33:02 +00:00
"execution_count": 58,
2023-04-13 09:42:51 +00:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
2023-04-13 10:33:02 +00:00
"<seaborn.axisgrid.PairGrid at 0x2aecc151110>"
2023-04-13 09:42:51 +00:00
]
},
2023-04-13 10:33:02 +00:00
"execution_count": 58,
2023-04-13 09:42:51 +00:00
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA9oAAAPaCAYAAABoFyBHAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/P9b71AAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdeXiU9b3//9dknWwzxIxhjYom1qOAUPhKLUu1pVK1UJHz/ar1VMXWntMW9ZQugvuCoPZUrdZK3dtzTo+eliM/q62tpVIWOVI1FNSKBFECyJKQzCSzZDLL749kxiSzJ/dsyfNxXbmUe33fn23u9yz3xxQMBoMCAAAAAACGKMh2AAAAAAAADCck2gAAAAAAGIhEGwAAAAAAA5FoAwAAAABgIBJtAAAAAAAMRKINAAAAAICBSLQBAAAAADAQiTYAAAAAAAYi0U5RMBiUw+FQMBjMdigARJ8Ecgn9Ecgd9Ecgu0i0U9TR0SGr1aqOjo5shwJA9Ekgl9AfgdxBfwSyi0QbAAAAAAADkWgDAAAAAGAgEm0AAAAAAAxEog0AAAAAgIFItAEAAAAAMFBRtgMYio0bN+pHP/qR3nzzTX388cd6/vnnddFFF8XdZ8OGDVq2bJneeecd1dXV6eabb9ZVV12VkXgBZN7+Npc6PD453N2ylhWr0lykCdXlhmyf6rEPtLnk6LN9lblI42Nsb3d51dLplcPTLUtZsWwVJbKWlxh2nemSSt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ef0wtHPOOUfx3id45plnou7T2NiYxqgAAAAAACP
"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 10:33:02 +00:00
"execution_count": 59,
2023-04-13 09:42:51 +00:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
2023-04-13 10:33:02 +00:00
"<seaborn.axisgrid.PairGrid at 0x2aecd0e1750>"
2023-04-13 09:42:51 +00:00
]
},
2023-04-13 10:33:02 +00:00
"execution_count": 59,
2023-04-13 09:42:51 +00:00
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAfAAAAHwCAYAAABZrD3mAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/P9b71AAAACXBIWXMAAA9hAAAPYQGoP6dpAABT3UlEQVR4nO3deVwV9f4/8NdhO4f1oB4BUQQX0lTAha+Emcs3jNSLWt571byKa2UhKppCV8UsRa3Q7Guau3UrvUV6c0krrrgkSeJaJgJiuLGpcFiEwzK/P/p58sh2hrPAwOv5eJzHgzPzmZn3HGZ4MXNmPiMTBEEAERERSYpFYxdARERE4jHAiYiIJIgBTkREJEEMcCIiIgligBMREUkQA5yIiEiCGOBEREQSxAAnIiKSoBYX4IIgQK1Wg/3XEJke9zci02lxAV5YWAilUonCwsLGLoWo2eP+RmQ6LS7AiYiImgMGOBERkQQxwImIiCSIAU5ERCRBVo258OPHj+Pdd99FcnIy7ty5g71792LMmDF1TpOQkICIiAj8+uuv8PDwwOLFizFlyhSz1EtExnXzfgkKSyugflAOpa01HBRW6NDKzqxtb90vgfqRto4KK7SvpW1BiQZ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s7dq1GDt2LL799lsEBAQAAJKSkpCamoq4uDijF0hERETViT4CHzFiBFJTUxESEoJ79+7h3r17CAkJwdWrVzFixAhT1EhERESPaVBHLh06dMDKlSuNXQsRERHpqUEBnp+fj6SkJOTk5KCqqkpn3OTJk41SGBEREdVOdIDv378fEyd
"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)"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"to find a correlation we remove the zero value & find correlation"
]
},
{
"cell_type": "code",
2023-04-13 10:33:02 +00:00
"execution_count": 60,
2023-04-13 09:42:51 +00:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
2023-04-13 10:33:02 +00:00
"<seaborn.axisgrid.PairGrid at 0x2aebcea1e50>"
2023-04-13 09:42:51 +00:00
]
},
2023-04-13 10:33:02 +00:00
"execution_count": 60,
2023-04-13 09:42:51 +00:00
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAfAAAAHwCAYAAABZrD3mAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/P9b71AAAACXBIWXMAAA9hAAAPYQGoP6dpAABS0klEQVR4nO3de1wU9f4/8NeCsMttF2WViyJ4IU0FvHAkzEt9xYOXg5qejlpH8doVb+S1o2KZop5Cq59pal7qW+kpy5NpWHEkNUlSRC1TATG8gIrKLvflMr8/+rqHldsOe2Pg9Xw89vFgZz4z855xZl/O7MxnZYIgCCAiIiJJsbN1AURERCQeA5yIiEiCGOBEREQSxAAnIiKSIAY4ERGRBDHAiYiIJIgBTkREJEEMcCIiIglqcQEuCAK0Wi3Yfw2R5fF4I7KcFhfgBQUFUKlU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rC9z/4eASGo6tHbG6qcCMbCrh8HwB3dEP3wTmNj27RtoX/1mLZWzI9aOD8LgALVB28EBaqwbH1TjBiaxtViSmNrFbBOx85YyKa+nTe9CLywsREZGBgCgT58+iI+Px5NPPok2bdqgY8eOWLp0KW7cuIEPP/wQwB+PkfXq1Qsvv/wypk+fjv/85z+YM2cODh48aPRjZMbehZ6amop+/fph2D92ok3HbqavbDX3si/hu9XTcPr0afTt29es8yZqSho63h48S11QWg43xR/PJBvzHLix7R888/ygvdKI58AftFW7GvccuLG1WJKY2sVsE7HzljIprqdNL6GfOnUKTz75pP79g+/OoqKisGvXLuTk5CA7O1s/vlOnTjh48CDmz5+Pt99+Gx06dMD27dv5DDiRRIkNPLHt27d2Rnsj26qcxX1g2yqsayOmdjHbROy8pUyK62nTAH/iiSfq/Z3gXbt21TrNmTNnLFgVERFR0yep78CJiIjoDwxwIiIiCWKAExERSRADnIiISIIY4ERERBLEACciIpIgBjgREZEEMcCJiIgkiAFOREQkQQxwIiIiCWKAExERSRADnIiISIIY4ERERBLEACciIpIgBjgREZEEMcCJiIgkiAFOREQkQQxwIiIiCWKAExERSRADnIiISIIY4ERERBLEACciIpIgBjgREZEEMcCJiIgkSHSAl5aW1jkuJyfHpGKIiIjIOKIDvG/fvkhLS6sxfN++fQgKCjJHTURERNQA0QH+xBNP4LHHHsO6desAAEVFRZg6dSomT56MV1991ewFEhERUU2iA/y9997Dvn37sHHjRgwaNAjBwcFIS0tDSkoK5s+fL7qATZs2wd/fHwqFAqGhoUhJSam3/caNG9GtWzc4OTnB19cX8+fPr/eyPhERUXPUqjETjRgxAuPGjcPmzZvRqlUrHDhwAL169RI9n7179yImJgZbtmxBaGgoNm7ciIiICFy6dAnt2rWr0f6TTz7BkiVLsGPHDgwYMACXL1/G1KlTIZPJEB8f35hVISIikiTRZ+CZmZkICwvD119/jcOHD2PRokUYPXo0Fi1ahPLyclHzio+Px6xZszBt2jT06NEDW7ZsgbOzM3bs2FFr+xMnTuDxxx/HM888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3d3d6DvMKysrTSqIiIiIGmZUgB85ckT/99WrV7FkyRJMnTpVf9d5cnIydu/erX9em4iIiCzLqAAfMmSI/u/XX38d8fHxmDRpkn7Y6NGjERgYiK1btyIqKsr8VRIREZEB0XehJycnIyQkpMbwkJAQ/i43ERGRlYgOcF9f31rvQN++fTt/eYiIiMhKRD9GtmHDBowfPx7ffPMNQkNDAQApKSlIT0/Hvn37zF4gERER1ST6DHzkyJFIT09HZGQk7t27h3v37iEyMhKXL1/GyJEjLVEjERERPaRRHbl06NABa9asMXctREREZKRGBXh
"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",
"sns.pairplot(gaydflight3)"
]
},
{
"cell_type": "code",
2023-04-13 10:33:02 +00:00
"execution_count": 61,
2023-04-13 09:42:51 +00:00
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAlUAAAHpCAYAAACr5skhAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/P9b71AAAACXBIWXMAAA9hAAAPYQGoP6dpAABAYElEQVR4nO3deXiNd+L//9cRJJGN2CKVEPuaoMqk9qmW0Fi7GUOUDmpvWsV8aqslpS1qabRqa4fSKVLaYlRFqnYR1bElBFFbpyWR0CA5vz/6m/OdU0FO3Ml9Es/HdZ3ryr2/cmYyXvO+7/M+FqvVahUAAAAeSDGzAwAAABQFlCoAAAADUKoAAAAMQKkCAAAwAKUKAADAAJQqAAAAA1CqAAAADFDkS5XValVaWpqYjgsAAOSnIl+qrl27Jh8fH127ds3sKAAAoAgr8qUKAACgIFCqAAAADECpAgAAMAClCgAAwACUKgAAAANQqgAAAAxAqQIAADAApQoAAMAAlCoAAAADUKoAA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V8+bN7fYPDbX/P5aHDh3SsmXL5OnpaXt16NBB2dnZSk5OliSVKVNGixcvVnR0tKpXr37HaFduUaoAACgEMjIy1KFDB3l7e2vFihXat2+f1q1bJ0l2zz+99NJLWrVqlW7cuKGlS5fq+eefd/g21h+Fh4fr119/1aJFi7Rnzx7t2bPnjutKuuOTey+99JJOnTqlPn366PDhw2ratKnmzZvn0LX/+LC7xWK547b
"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",
")"
]
},
{
"cell_type": "code",
2023-04-13 10:33:02 +00:00
"execution_count": 62,
2023-04-13 09:42:51 +00:00
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAm8AAAHpCAYAAADUN9vQAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/P9b71AAAACXBIWXMAAA9hAAAPYQGoP6dpAAA9oElEQVR4nO3de3zO9eP/8edls4PZxohZNuaQ8yYWKYUPxWhEB/XxYU6lshxWC31yiiwUOmgq535EJ9KJj+SQcp5J0QzDcv4Wm00N2/v3Rx/Xp6sh11y73tdbj/vtdt3a+329X+/3cxeu27PX+/2+LpthGIYAAABgCaXMDgAAAICrR3kDAACwEMobAACAhVDeAAAALITyBgAAYCGUNwAAAAuhvAEAAFjIdV/eDMNQTk6O+Dg7AABwPbjuy9uZM2cUHBysM2fOmB0FAADgml335Q0AAOB6QnkDAACwEMobAACAhVDeAAAALITyBgAAYCGUNwAAAAuhvAEAAFgI5Q0AAMBCKG8AAAAWQnkDAACwEMobAACAhVDe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JcLq8DR8+XDt27NCaNWvk5+dnX9+uXTstWrTIpeEAAADgyOmPClm6dKkWL16sW2+9VTabzb6+QYMG2rdvn0vDAQAAwJHTM28nT55UpUqViqzPy8tzKHMAAABwPafLW0xMjD777DP78sXCNnPmTLVo0cJ1yQAAAFCE06dNJ0yYoNjYWO3atUsXLlzQK6+8ol27dunbb7/V2rVrSyI
"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",
")"
]
},
{
"attachments": {},
"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-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
}