{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "

\"FT

\n", "

Saint Paul (MN) 2019 City Council Election Supplemental Report
\n", " Published 12/02/19

\n", "

By Frogtown Crusader (Abu Nayeem)

" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Table of contents \n", "\n", "* [Brief Introduction](#intro)\n", "* [About Saint Paul Open Data Initiative](#opendata)\n", "* [Reader Note](#reader)\n", "* [Section I: Data Analysis](#sect1)\n", " * [About Data](#aboutdata)\n", " * [Data Assumptions](#data_assumption)\n", " * [Voter Age Demographics](#demo)\n", " * [Voting Trends](#trend)\n", " * [Youth Votes](#youth)\n", " * [Ward Summary Stats](#wardstats)\n", " * [Saint Paul Precinct Maps]\n", " * [The percentage of voters that voted in 2017 Mayor election](#mayor)\n", " * [The percentage of voters that voted in 2015 City council election](#city)\n", " * [High Density Map](#highdensity)\n", " * [Difference of voting% between density groups](#densdiff)\n", " * [Etymology](#ety)\n", " * [Precinct Analysis: Fragmentation](#precinct)\n", " * [Ward 1](#ward1)\n", " * [Ward 2](#ward2)\n", " * [Ward 3](#ward3)\n", " * [Ward 4](#ward4)\n", " * [Ward 5](#ward5)\n", " * [Ward 6](#ward6)\n", " * [Ward 7](#ward7)\n", "* [Summary Stats/ Numbers](#final)\n", "* [Run Code](#code)\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Brief Introduction \n", "\n", "In this report, I will be using Minnesota Voting Data/Records to show insight on the 2019 Saint Paul city council elections. As part of the Saint Paul Open-Data Project, the coding will be accessible to everyone. This is **only a data report**, the qualitative and solution portion was excluded so readers can come up with their own conclusions. The data workbook can be viewed here.\n", "\n", "The first report focused on the election result, this report will be providing additional insight on general voter pattern. There is a few new reporting tools that I explored that were different than the past.\n", "\n", "1. **Data Analysis [Informational]**: Include voting rate for different elections, Ward analysis, Youth voter rate, and Precinct analysis, Etymology Analysis\n", "\n", "**Disclaimer:** I ran for Saint Paul city council for Ward 1 (election on November 5th, 2019). \n" ] }, { "cell_type": "markdown", "metadata": { "heading_collapsed": true }, "source": [ "### Saint Paul Open Data Initiative \n", "\n", "This initiative focuses on taking public information/data from municipalities and organizations to create interactive reports and analysis to better inform and assist community members to take action. This is an open-source project meaning that all coding is accessible to everyone, and thus there is transparency on the results. It is currently all python-based. As always, I encourage other programmers and developers to participate in making this more accessible. You can learn more information on the project [Github](https://github.com/sustainabu/OpenData_Saint_Paul) page as well as accessing documents.\n", "\n", "Unlike my previous reports, the Minnesota voting records is not publicly available, but is publicly accessible. I will not provide the raw data on the project page as it contains sensitive personal information, you can contact the Minnesota Secretary of State for the voting records [here](https://www.sos.state.mn.us/media/2641/registered-voter-list-request-form.pdf), which also includes the columns provided. \n", "\n", "\n", "**If you use any material/graphs from the report, please give credit to me and the project**\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Reader's Note \n", "\n", "There are a few questions that I want you to consider when reviewing the data analysis:\n", "\n", "1. Why does our local elections matter?\n", "2. Was their any demographic shifts? \n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Section I: Data Analysis " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### About the Data: \n", "\n", "The data is taken from Minnesota voting records and the data was current of 11/10/2019 as indicated in the picture below. There are two datasets in the CD: Voter profile and Voting Records. This is the bare basic voting information obtained from the state that it is utilized by most campaigns. **You can view the [full data workbook](https://github.com/sustainabu/OpenData_Saint_Paul/blob/master/_Saint%20Paul%20City%20Council%20Election%20Analysis/2019%20City%20Council%20Supplemental%20Workbook.ipynb) here**. In addition, I got geojson file for my map [here](https://www.sos.state.mn.us/election-administration-campaigns/data-maps/geojson-files/) **Note: there is missing election data for voters in Ward 2-Precinct 5 & Ward 3- Precinct 13.** \n", "\n", "\"Drawing\"\n", "\n", "\n", "\n", "\n", "### Background: \n", "\n", "As a Saint Paul resident, I am represented by different layers of governance, whom I can vote for during an election. The layers of governance can be broken down into four categories: Federal, State, County, and Local. **Only the local city election occur during the odd calendar years**. The other government roles have the elections on even years and the available open seats are staggered. In Saint Paul, the city council elections shares the staggered term of the school board. The Saint Paul City Council member term is four years and is not staggered. In contrast, the sister city, Minneapolis, has the mayoral and city council election occurs at the same time calendar year.\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Data Assumptions: \n", "\n", "**Assumptions:** \n", "The raw data contains the records of registered voters, so there might be some voters whom that have not registered within and/or outside Saint Paul. In addition, some voters may likely be deceased (i.e. there are 120 year olds), and their voter information has not been removed from the records. In both cases, the numbers are negligible and substantial data cleaning is unnecessary for this report. You can see the full python workbook for all the tables and charts [here]()\n", "\n", "Methodology:\n", "\n", "1) **Time Sensitivity on Registered Voters:** It is sensitive to time, especially within the last three years. Time sensitivity is less for older populations as there is numerous years giving accurate number on the total potentional registered voters. It is recommended to do a youth analysis, after at least one major federal/state elections \n", "\n", "2) **Finding the approximate age of registered voters:** For each registered voter, the year for date of birth was provided, which was used to determine their relative age. The actual age is important for 18 year olds, as they are not able to vote if they turn 18 after a general election, so they have 1/6 less representation\n", "\n", "3) **Finding the number of potential registered voters at a given election year:** This is done through a post-hoc method where I take the voter registration of succeeding elections to determine the number of people in the age group that could have voted. This is similar to the time sensitivity\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Age/Voter Demographics: \n", "\n", "First, let’s explore the age demographic relationship between Saint Paul and Minneapolis as these two cities are closely connected. From the plots below, we see that Minneapolis has greater concentration of younger voters than Saint Paul, and the total number of voters are higher in general. For both cities, the younger adults make up the bulk of voting population.\n", "\n", "\"Drawing\"\n", "\n", "\"Drawing\"\n", "\n", "**New Voter Registration from 06/24/19 to 11/29/19**\n", "\n", "From the graphs below we see that this election had increase number of registered voters for younger population and decrease for older people. One possibility for this is that old people are leaving their homes, and replace with younger population\n", "\n", "\"Drawing\"\n", "\n", "\"Drawing\"\n", "\n", "The table below shows the voter registry for the Wards, why Ward 4 had a drastic decrease in registry is interesting.\n", "\n", "\"Drawing\"\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Voting Trends: \n", "\n", "Local elections tend to have low turnout. Notice that 2019 city council elections mirrors that of the Mayor's election of 2017, but with greater proportion of older voters voting.\n", "\n", "\"Drawing\"\n", "\n", "The following graph below compares voter age distribution for the city council election of the 2015 to 2019 city council election.\n", "\n", "\"Drawing\"\n", "\n", "The following graph below shows the breakdown voter age breakdown of each ward.\n", "\n", "\"Drawing\"\n", "\n", "Finally, the graph below plots the voter participation rate by age group. Notice, the Saint Paul young adult participation is low despite being the larger demographic and surprisingly 2019 city council follow close to the mayor's turnout\n", "\n", "\"Drawing\"\n", "\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Ward/Youth Vote (Age18-21): \n", " \n", "From the following tables below we see the voting and youth participation rate with Ward 3 having a higher voter turnout. The youth turnout is considerably better than 2015 results\n", "\n", "\"Drawing\"\n" ] }, { "cell_type": "markdown", "metadata": { "heading_collapsed": true }, "source": [ "### Ward Statistics: \n", "\n", "The following table shows the Ward summary statistics. Here is a brief explanation of the columns.\n", "* **H_Density%:** The percentage of people in the ward living in high density (>39 people in address) living spaces\n", "* **H_Density_Vote%:** The voting% of people living in high density\n", "* **L_Density_Vote%:** The voting% of people living in low density (<39 people)\n", "* **Vote_Mayor%:** The percentage of voters that also voted in the Mayor Election\n", "* **Vote_State%:** The percentage of voters that also voted in the Senate Election\n", "* **Vote_LastCity%:** The percentage of voters that also voted in the 2015 city council Election\n", "* **Uncap_LastCity%:** The percentage of voters that voted in 2015 city council, but not in 2019 city council\n", "\n", "\"Drawing\"\n", "\n", "The **Vote_LastCity%** being low makes me wonder why didn't previous voters vote? Also Ward 6, seems to get the greatest increase of non-traditional voters. The close alignment of voting in city council and Senate could be higher due to DFL involvement where the DFL-endorsed candidate get access to the voter base and/or the DFL took a position in the trash referendum. Finally, all the information on table is broken by precinct in later section \n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### The percentage of voters that also voted for the 2017 Mayor's election " ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "map_2019_SP_CityCouncilMayor_byPrecinct()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### The percentage of voters that also voted for the 2015 City Council election " ] }, { "cell_type": "code", "execution_count": 39, "metadata": { "scrolled": false }, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "execution_count": 39, "metadata": {}, "output_type": "execute_result" } ], "source": [ "map_2019_SP_CityCouncilLast_byPrecinct()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Saint Paul High-Density Registered Voter Map (>39 residents) \n", "\n", "**Note:** If white shaded indicates those precincts had no high density residents" ] }, { "cell_type": "code", "execution_count": 63, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "execution_count": 63, "metadata": {}, "output_type": "execute_result" } ], "source": [ "map_2019_SP_CityCouncilDensity_byPrecinct()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Saint Paul City Council Density Vote% Difference Map (Minimum requirement of 5% of high density) \n", "\n", "**Note:** A negative number, such as -31, indicates that high density residents has voted more than 31% points than low density residents. Likewise, a score of 36 indicates that low density residents vote 36% points higher than high density residents" ] }, { "cell_type": "code", "execution_count": 59, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "execution_count": 59, "metadata": {}, "output_type": "execute_result" } ], "source": [ "map_2019_SP_CityCouncilDensityDiff_byPrecinct()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Etymology Breakdown of LastName of Voters (Incomplete) \n", "\n", "There is a lot of information that is carried over by the names given to us by our parents. When you look at the etymology (origin of word) for names we learn about the influence of our descendents, culture, language, and faith's history. Furthermore, cultures can have different naming customs, that is passed on to generations. In America, the former-slaves, African Americans, lost their culture, which can be seen by them losing their names. For immigrant communities they often assimilate to the new country, which means changing their children's first name to the dominant culture which happen White/ Christian names. Finally, for some cultures the surname can provide information of descendent economic occupation within a society, such as Baker, and/or connection to a clan. So when encountering someone's name, we have some basic information of their latest cultural influence. This information can be used to determine some group effects, while protecting individual identity. The exploratory data analysis is to determine if there are interesting trends within these groups and what can we do with this information, which can be context and culturally explicit. The following below is the demographic history of Saint Paul. \n", "\n", "As of the 2000 U.S. Census, there were 287,151 people, 112,109 households, and 60,999 families residing in the Saint Paul. The racial makeup of the city was 67.0% White, 11.7% African American, 1.1% Native American, 12.4% Asian (mostly Hmong), 0.1% Pacific Islander, 3.8% from other races, and 3.9% from two or more races. Hispanic or Latino people of any race were 7.9% of the population. In terms of people who specified European ancestry in the 2005–2007 American Community Survey, the city was 26.4% German, 13.8% Irish, 8.4% Norwegian, 7.0% Swedish, and 6.2% English. There is also a visible community of people of Sub-Saharan African ancestry, representing 4.2% of Saint Paul's population. (Wikipedia) \n", "\n", "In this analysis, I could confidently differentiate (w/ Internet search and querying the raw data) the surnames of three common etymology categories appropriate in Saint Paul. This is a **valid research method** as a [study](https://www.nature.com/news/collaboration-strength-in-diversity-1.15912#:~:targetText=Nature%20%26%20Scientific%20American%20special%3A%20Diversity&targetText=Papers%20with%20four%20or%20five,citations%20for%20a%20given%20publication.) used the name of the authors of academic papers to determine the impact of diversity in the number of citations. Note: I was not confidently be able to distinguish European origin because it is the dominant culture so there is inter-mixing, and they share common surnames for African-Amercians (i.e. due to slavery). My designations are available in this [Google Spreadsheet](https://docs.google.com/spreadsheets/d/1nxcyfGPQ6u7DFRynH0lJzSEQcjtfsFBKa88t3HfyiDs/edit?usp=sharing). My methodology was identifying the most frequent surnames, on the registry list, last name (>25) and first names (>50). The list was astounding, as expected the most common first names tend to be Christian/biblical origin, while for surnames there was much greater frequency of East/South Asian origin. The table below are the aggregate data using categorizing first and last name. From the table, we see that there significantly more 'Not-Identified\" first names and the first name column covered more of the sample size despite having a frequency criteria. \n", "\n", "\"Drawing\"\n", "\n", "\n", "For the analysis itself, only the etymology category \"East/SouthEast Asian\" had a large enough sample size to do some preliminary analysis. I just used the last name to categorize. On the graph below, the registry and voting age distribution closely aligns. This was true for etymology of Hispanic and Arabic origin.\n", "\n", "\"Drawing\"\n", "\n", "The following graph below shows the voting percentage. Notice that the young people have the same voting rate as the average American. There is a voting gap for older adults\n", "\n", "\n", "\"Drawing\"\n", "\n", "I have not looked further into data due to the general public sensitivity of racial/ethnic related data." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Precinct Analysis: Fragmentation \n", "\n", "This is essentially the Ward analysis, but broken down to each precinct. \n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Ward 1 Precinct Analysis \n", "\n", "\"Drawing\"\n" ] }, { "cell_type": "code", "execution_count": 40, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
WardPrecinctTot_Vote%LastCity_Vote%H_Dens%H_Dens_Vote%L_Dens_Vote%Vote_Mayor%Vote_LastCity%Vote_Sen%
01W-1 P-147.6924.780.000.0049.0378.3941.5196.05
11W-1 P-235.3513.1031.2227.2740.0166.5027.3894.00
21W-1 P-325.459.714.365.9525.6171.2826.2193.71
31W-1 P-425.7210.570.000.0024.9371.2631.3290.80
41W-1 P-525.7811.296.166.9826.9368.2530.9294.71
51W-1 P-632.7112.512.3010.7732.0872.6228.4095.62
61W-1 P-744.2718.280.000.0044.0471.4136.7697.58
71W-1 P-829.7512.7916.5420.9630.3870.8926.9996.75
81W-1 P-919.308.1811.2617.4119.0958.0626.2784.33
91W-1 P-1020.857.920.000.0018.9456.1832.5885.39
101W-1 P-1118.8711.5328.3925.0815.2766.8337.0288.94
111W-1 P-1244.2120.1214.6361.2243.0180.3942.4898.04
121W-1 P-1337.0115.428.5534.0037.2375.0034.4998.38
131W-1 P-1425.5613.6226.5038.8518.4554.7027.7884.62
141W-1 P-1520.815.2911.4218.6022.1949.3916.4688.41
151W-1 P-1629.1013.190.000.0028.6977.1442.8697.14
\n", "
" ], "text/plain": [ " Ward Precinct Tot_Vote% LastCity_Vote% H_Dens% H_Dens_Vote% \\\n", "0 1 W-1 P-1 47.69 24.78 0.00 0.00 \n", "1 1 W-1 P-2 35.35 13.10 31.22 27.27 \n", "2 1 W-1 P-3 25.45 9.71 4.36 5.95 \n", "3 1 W-1 P-4 25.72 10.57 0.00 0.00 \n", "4 1 W-1 P-5 25.78 11.29 6.16 6.98 \n", "5 1 W-1 P-6 32.71 12.51 2.30 10.77 \n", "6 1 W-1 P-7 44.27 18.28 0.00 0.00 \n", "7 1 W-1 P-8 29.75 12.79 16.54 20.96 \n", "8 1 W-1 P-9 19.30 8.18 11.26 17.41 \n", "9 1 W-1 P-10 20.85 7.92 0.00 0.00 \n", "10 1 W-1 P-11 18.87 11.53 28.39 25.08 \n", "11 1 W-1 P-12 44.21 20.12 14.63 61.22 \n", "12 1 W-1 P-13 37.01 15.42 8.55 34.00 \n", "13 1 W-1 P-14 25.56 13.62 26.50 38.85 \n", "14 1 W-1 P-15 20.81 5.29 11.42 18.60 \n", "15 1 W-1 P-16 29.10 13.19 0.00 0.00 \n", "\n", " L_Dens_Vote% Vote_Mayor% Vote_LastCity% Vote_Sen% \n", "0 49.03 78.39 41.51 96.05 \n", "1 40.01 66.50 27.38 94.00 \n", "2 25.61 71.28 26.21 93.71 \n", "3 24.93 71.26 31.32 90.80 \n", "4 26.93 68.25 30.92 94.71 \n", "5 32.08 72.62 28.40 95.62 \n", "6 44.04 71.41 36.76 97.58 \n", "7 30.38 70.89 26.99 96.75 \n", "8 19.09 58.06 26.27 84.33 \n", "9 18.94 56.18 32.58 85.39 \n", "10 15.27 66.83 37.02 88.94 \n", "11 43.01 80.39 42.48 98.04 \n", "12 37.23 75.00 34.49 98.38 \n", "13 18.45 54.70 27.78 84.62 \n", "14 22.19 49.39 16.46 88.41 \n", "15 28.69 77.14 42.86 97.14 " ] }, "execution_count": 40, "metadata": {}, "output_type": "execute_result" } ], "source": [ "P19.query('Ward==1')" ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "map_2019_SP_CityCouncilMayor_byPrecinct(1)" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "execution_count": 26, "metadata": {}, "output_type": "execute_result" } ], "source": [ "map_2019_SP_CityCouncilLast_byPrecinct(1)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Ward 2 Precinct Analysis \n", "\n", "**Note:** Precinct 13 is missing data\n", "\n", "\"Drawing\"\n", "\n", "[Additional Map Link](https://www.ramseycounty.us/sites/default/files/Elections%20and%20Voting/Maps/Saint%20Paul%20maps/Saint%20Paul%202019%20maps/Saint%20Paul%20Ward%202_5.25.pdf)\n" ] }, { "cell_type": "code", "execution_count": 41, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
WardPrecinctTot_Vote%LastCity_Vote%H_Dens%H_Dens_Vote%L_Dens_Vote%Vote_Mayor%Vote_LastCity%Vote_Sen%
162W-2 P-143.7727.630.000.0043.7778.5251.3598.15
172W-2 P-243.8227.220.000.0044.2076.7948.2896.55
182W-2 P-330.7617.3515.9813.0136.9563.1136.7895.37
192W-2 P-432.3919.620.000.0032.7177.3244.5897.24
202W-2 P-534.0622.5615.3320.1139.0368.6044.4896.13
212W-2 P-630.7717.2573.8826.2539.8866.1336.5695.16
222W-2 P-727.0717.0946.6118.8736.3969.6142.9595.66
232W-2 P-821.6912.9671.4719.2125.9468.5935.7492.42
242W-2 P-927.6618.3784.8227.4126.1173.0043.5296.63
252W-2 P-1123.8712.3594.4521.8126.3866.6737.9694.75
262W-2 P-1237.7225.790.000.0039.3867.2445.4995.85
272W-2 P-1332.0623.1313.600.000.00NaNNaNNaN
282W-2 P-1428.6018.210.000.0029.2460.5645.8897.38
292W-2 P-1517.8311.278.7312.0319.2153.0236.2692.20
\n", "
" ], "text/plain": [ " Ward Precinct Tot_Vote% LastCity_Vote% H_Dens% H_Dens_Vote% \\\n", "16 2 W-2 P-1 43.77 27.63 0.00 0.00 \n", "17 2 W-2 P-2 43.82 27.22 0.00 0.00 \n", "18 2 W-2 P-3 30.76 17.35 15.98 13.01 \n", "19 2 W-2 P-4 32.39 19.62 0.00 0.00 \n", "20 2 W-2 P-5 34.06 22.56 15.33 20.11 \n", "21 2 W-2 P-6 30.77 17.25 73.88 26.25 \n", "22 2 W-2 P-7 27.07 17.09 46.61 18.87 \n", "23 2 W-2 P-8 21.69 12.96 71.47 19.21 \n", "24 2 W-2 P-9 27.66 18.37 84.82 27.41 \n", "25 2 W-2 P-11 23.87 12.35 94.45 21.81 \n", "26 2 W-2 P-12 37.72 25.79 0.00 0.00 \n", "27 2 W-2 P-13 32.06 23.13 13.60 0.00 \n", "28 2 W-2 P-14 28.60 18.21 0.00 0.00 \n", "29 2 W-2 P-15 17.83 11.27 8.73 12.03 \n", "\n", " L_Dens_Vote% Vote_Mayor% Vote_LastCity% Vote_Sen% \n", "16 43.77 78.52 51.35 98.15 \n", "17 44.20 76.79 48.28 96.55 \n", "18 36.95 63.11 36.78 95.37 \n", "19 32.71 77.32 44.58 97.24 \n", "20 39.03 68.60 44.48 96.13 \n", "21 39.88 66.13 36.56 95.16 \n", "22 36.39 69.61 42.95 95.66 \n", "23 25.94 68.59 35.74 92.42 \n", "24 26.11 73.00 43.52 96.63 \n", "25 26.38 66.67 37.96 94.75 \n", "26 39.38 67.24 45.49 95.85 \n", "27 0.00 NaN NaN NaN \n", "28 29.24 60.56 45.88 97.38 \n", "29 19.21 53.02 36.26 92.20 " ] }, "execution_count": 41, "metadata": {}, "output_type": "execute_result" } ], "source": [ "P19.query('Ward==2')" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "map_2019_SP_CityCouncilMayor_byPrecinct(2)" ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "execution_count": 28, "metadata": {}, "output_type": "execute_result" } ], "source": [ "map_2019_SP_CityCouncilLast_byPrecinct(2)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Ward 3 Precinct Analysis \n", "\n", "**Note**:Precinct 5 has missing data\n", "\n", "\"Drawing\"" ] }, { "cell_type": "code", "execution_count": 42, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
WardPrecinctTot_Vote%LastCity_Vote%H_Dens%H_Dens_Vote%L_Dens_Vote%Vote_Mayor%Vote_LastCity%Vote_Sen%
303W-3 P-152.0720.090.000.0051.6780.9232.0797.70
313W-3 P-250.1421.650.000.0049.9480.0836.2497.44
323W-3 P-342.1615.5613.2725.5544.3376.8329.7997.82
333W-3 P-445.1823.1135.7226.1853.6479.0038.6797.50
343W-3 P-534.8613.7348.510.000.00NaNNaNNaN
353W-3 P-644.7516.200.000.0044.1376.2730.3097.56
363W-3 P-737.5719.0847.8216.3349.1462.4026.0388.22
373W-3 P-854.1720.633.2818.8755.9777.8832.3997.52
383W-3 P-949.1817.936.6932.1450.0975.0630.6496.58
393W-3 P-1049.2417.770.000.0049.3182.5630.3697.07
403W-3 P-1118.758.2247.5123.3214.1367.0330.7795.88
413W-3 P-1251.3818.910.000.0051.4977.6232.0197.22
423W-3 P-1349.4921.4714.6341.7050.4178.4633.9698.13
433W-3 P-1451.5118.664.2051.3251.7275.5330.4597.49
\n", "
" ], "text/plain": [ " Ward Precinct Tot_Vote% LastCity_Vote% H_Dens% H_Dens_Vote% \\\n", "30 3 W-3 P-1 52.07 20.09 0.00 0.00 \n", "31 3 W-3 P-2 50.14 21.65 0.00 0.00 \n", "32 3 W-3 P-3 42.16 15.56 13.27 25.55 \n", "33 3 W-3 P-4 45.18 23.11 35.72 26.18 \n", "34 3 W-3 P-5 34.86 13.73 48.51 0.00 \n", "35 3 W-3 P-6 44.75 16.20 0.00 0.00 \n", "36 3 W-3 P-7 37.57 19.08 47.82 16.33 \n", "37 3 W-3 P-8 54.17 20.63 3.28 18.87 \n", "38 3 W-3 P-9 49.18 17.93 6.69 32.14 \n", "39 3 W-3 P-10 49.24 17.77 0.00 0.00 \n", "40 3 W-3 P-11 18.75 8.22 47.51 23.32 \n", "41 3 W-3 P-12 51.38 18.91 0.00 0.00 \n", "42 3 W-3 P-13 49.49 21.47 14.63 41.70 \n", "43 3 W-3 P-14 51.51 18.66 4.20 51.32 \n", "\n", " L_Dens_Vote% Vote_Mayor% Vote_LastCity% Vote_Sen% \n", "30 51.67 80.92 32.07 97.70 \n", "31 49.94 80.08 36.24 97.44 \n", "32 44.33 76.83 29.79 97.82 \n", "33 53.64 79.00 38.67 97.50 \n", "34 0.00 NaN NaN NaN \n", "35 44.13 76.27 30.30 97.56 \n", "36 49.14 62.40 26.03 88.22 \n", "37 55.97 77.88 32.39 97.52 \n", "38 50.09 75.06 30.64 96.58 \n", "39 49.31 82.56 30.36 97.07 \n", "40 14.13 67.03 30.77 95.88 \n", "41 51.49 77.62 32.01 97.22 \n", "42 50.41 78.46 33.96 98.13 \n", "43 51.72 75.53 30.45 97.49 " ] }, "execution_count": 42, "metadata": {}, "output_type": "execute_result" } ], "source": [ "P19.query('Ward==3')" ] }, { "cell_type": "code", "execution_count": 29, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "execution_count": 29, "metadata": {}, "output_type": "execute_result" } ], "source": [ "map_2019_SP_CityCouncilMayor_byPrecinct(3)" ] }, { "cell_type": "code", "execution_count": 30, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "execution_count": 30, "metadata": {}, "output_type": "execute_result" } ], "source": [ "map_2019_SP_CityCouncilLast_byPrecinct(3)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Ward 4 Precinct Analysis \n", "\n", "\"Drawing\"" ] }, { "cell_type": "code", "execution_count": 43, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
WardPrecinctTot_Vote%LastCity_Vote%H_Dens%H_Dens_Vote%L_Dens_Vote%Vote_Mayor%Vote_LastCity%Vote_Sen%
444W-4 P-143.6226.362.6423.2643.2979.6346.0598.85
454W-4 P-251.1837.825.6168.4250.4783.0757.5395.98
464W-4 P-324.457.9866.0620.0330.6967.6723.0995.03
474W-4 P-442.1420.660.000.0042.1675.7338.5298.15
484W-4 P-543.0922.190.000.0042.4273.9138.1897.20
494W-4 P-626.4413.3444.405.2537.8375.0735.1897.78
504W-4 P-743.2223.633.381.6145.1082.6541.5797.50
514W-4 P-836.3318.840.000.0035.9676.4740.4397.12
524W-4 P-932.2916.4715.4941.6329.8969.5835.9397.15
534W-4 P-1046.1022.790.000.0043.7179.9842.6397.64
544W-4 P-1140.6023.1215.3913.6646.0176.4442.0996.18
554W-4 P-1227.8611.0236.7514.7336.0773.0631.4396.12
564W-4 P-1336.7419.3116.7816.3339.6074.5338.2098.13
574W-4 P-1438.8020.860.000.0037.7679.6046.0397.47
584W-4 P-1542.4119.477.9615.7045.8277.7337.7396.06
\n", "
" ], "text/plain": [ " Ward Precinct Tot_Vote% LastCity_Vote% H_Dens% H_Dens_Vote% \\\n", "44 4 W-4 P-1 43.62 26.36 2.64 23.26 \n", "45 4 W-4 P-2 51.18 37.82 5.61 68.42 \n", "46 4 W-4 P-3 24.45 7.98 66.06 20.03 \n", "47 4 W-4 P-4 42.14 20.66 0.00 0.00 \n", "48 4 W-4 P-5 43.09 22.19 0.00 0.00 \n", "49 4 W-4 P-6 26.44 13.34 44.40 5.25 \n", "50 4 W-4 P-7 43.22 23.63 3.38 1.61 \n", "51 4 W-4 P-8 36.33 18.84 0.00 0.00 \n", "52 4 W-4 P-9 32.29 16.47 15.49 41.63 \n", "53 4 W-4 P-10 46.10 22.79 0.00 0.00 \n", "54 4 W-4 P-11 40.60 23.12 15.39 13.66 \n", "55 4 W-4 P-12 27.86 11.02 36.75 14.73 \n", "56 4 W-4 P-13 36.74 19.31 16.78 16.33 \n", "57 4 W-4 P-14 38.80 20.86 0.00 0.00 \n", "58 4 W-4 P-15 42.41 19.47 7.96 15.70 \n", "\n", " L_Dens_Vote% Vote_Mayor% Vote_LastCity% Vote_Sen% \n", "44 43.29 79.63 46.05 98.85 \n", "45 50.47 83.07 57.53 95.98 \n", "46 30.69 67.67 23.09 95.03 \n", "47 42.16 75.73 38.52 98.15 \n", "48 42.42 73.91 38.18 97.20 \n", "49 37.83 75.07 35.18 97.78 \n", "50 45.10 82.65 41.57 97.50 \n", "51 35.96 76.47 40.43 97.12 \n", "52 29.89 69.58 35.93 97.15 \n", "53 43.71 79.98 42.63 97.64 \n", "54 46.01 76.44 42.09 96.18 \n", "55 36.07 73.06 31.43 96.12 \n", "56 39.60 74.53 38.20 98.13 \n", "57 37.76 79.60 46.03 97.47 \n", "58 45.82 77.73 37.73 96.06 " ] }, "execution_count": 43, "metadata": {}, "output_type": "execute_result" } ], "source": [ "P19.query('Ward==4')" ] }, { "cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "execution_count": 31, "metadata": {}, "output_type": "execute_result" } ], "source": [ "map_2019_SP_CityCouncilMayor_byPrecinct(4)" ] }, { "cell_type": "code", "execution_count": 32, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "execution_count": 32, "metadata": {}, "output_type": "execute_result" } ], "source": [ "map_2019_SP_CityCouncilLast_byPrecinct(4)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Ward 5 Precinct Analysis \n", "\n", "\"Drawing\"" ] }, { "cell_type": "code", "execution_count": 44, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
WardPrecinctTot_Vote%LastCity_Vote%H_Dens%H_Dens_Vote%L_Dens_Vote%Vote_Mayor%Vote_LastCity%Vote_Sen%
595W-5 P-141.5324.388.3313.3744.4668.6744.7497.92
605W-5 P-250.0237.995.4316.9152.3677.4557.4497.86
615W-5 P-345.8931.306.0335.7145.8269.8153.0797.14
625W-5 P-423.6913.601.6914.7523.6963.5041.4393.31
635W-5 P-518.3210.202.428.5117.6251.1823.3782.25
645W-5 P-624.5610.940.000.0024.4458.3029.7992.34
655W-5 P-720.3610.010.000.0020.4857.0929.1591.90
665W-5 P-817.299.535.7910.4217.8960.3732.4992.86
675W-5 P-919.378.960.000.0018.5557.7827.8490.42
685W-5 P-1014.987.597.887.6913.6557.4724.1495.40
\n", "
" ], "text/plain": [ " Ward Precinct Tot_Vote% LastCity_Vote% H_Dens% H_Dens_Vote% \\\n", "59 5 W-5 P-1 41.53 24.38 8.33 13.37 \n", "60 5 W-5 P-2 50.02 37.99 5.43 16.91 \n", "61 5 W-5 P-3 45.89 31.30 6.03 35.71 \n", "62 5 W-5 P-4 23.69 13.60 1.69 14.75 \n", "63 5 W-5 P-5 18.32 10.20 2.42 8.51 \n", "64 5 W-5 P-6 24.56 10.94 0.00 0.00 \n", "65 5 W-5 P-7 20.36 10.01 0.00 0.00 \n", "66 5 W-5 P-8 17.29 9.53 5.79 10.42 \n", "67 5 W-5 P-9 19.37 8.96 0.00 0.00 \n", "68 5 W-5 P-10 14.98 7.59 7.88 7.69 \n", "\n", " L_Dens_Vote% Vote_Mayor% Vote_LastCity% Vote_Sen% \n", "59 44.46 68.67 44.74 97.92 \n", "60 52.36 77.45 57.44 97.86 \n", "61 45.82 69.81 53.07 97.14 \n", "62 23.69 63.50 41.43 93.31 \n", "63 17.62 51.18 23.37 82.25 \n", "64 24.44 58.30 29.79 92.34 \n", "65 20.48 57.09 29.15 91.90 \n", "66 17.89 60.37 32.49 92.86 \n", "67 18.55 57.78 27.84 90.42 \n", "68 13.65 57.47 24.14 95.40 " ] }, "execution_count": 44, "metadata": {}, "output_type": "execute_result" } ], "source": [ "P19.query('Ward==5')" ] }, { "cell_type": "code", "execution_count": 33, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "execution_count": 33, "metadata": {}, "output_type": "execute_result" } ], "source": [ "map_2019_SP_CityCouncilMayor_byPrecinct(5)" ] }, { "cell_type": "code", "execution_count": 34, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "execution_count": 34, "metadata": {}, "output_type": "execute_result" } ], "source": [ "map_2019_SP_CityCouncilLast_byPrecinct(5)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Ward 6 Precinct Analysis \n", "\n", "\"Drawing\"" ] }, { "cell_type": "code", "execution_count": 45, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
WardPrecinctTot_Vote%LastCity_Vote%H_Dens%H_Dens_Vote%L_Dens_Vote%Vote_Mayor%Vote_LastCity%Vote_Sen%
696W-6 P-135.5012.040.000.0034.4263.9824.9594.37
706W-6 P-246.0219.740.000.0046.3470.5832.9996.09
716W-6 P-330.5213.060.000.0029.2861.4729.8990.95
726W-6 P-425.849.056.805.9326.6158.2026.4086.60
736W-6 P-527.339.750.000.0025.8059.9024.7486.01
746W-6 P-625.687.782.1719.3023.8657.7820.2286.68
756W-6 P-725.5111.2423.7646.0115.6862.4227.3982.80
766W-6 P-820.608.547.0133.9118.4159.6928.1278.44
776W-6 P-925.467.280.000.0024.7953.5821.8089.68
786W-6 P-1027.0811.7710.4630.8426.3161.3129.5691.24
796W-6 P-1133.2611.800.000.0033.3151.1424.1791.24
806W-6 P-1227.179.170.000.0026.9553.1124.2293.17
\n", "
" ], "text/plain": [ " Ward Precinct Tot_Vote% LastCity_Vote% H_Dens% H_Dens_Vote% \\\n", "69 6 W-6 P-1 35.50 12.04 0.00 0.00 \n", "70 6 W-6 P-2 46.02 19.74 0.00 0.00 \n", "71 6 W-6 P-3 30.52 13.06 0.00 0.00 \n", "72 6 W-6 P-4 25.84 9.05 6.80 5.93 \n", "73 6 W-6 P-5 27.33 9.75 0.00 0.00 \n", "74 6 W-6 P-6 25.68 7.78 2.17 19.30 \n", "75 6 W-6 P-7 25.51 11.24 23.76 46.01 \n", "76 6 W-6 P-8 20.60 8.54 7.01 33.91 \n", "77 6 W-6 P-9 25.46 7.28 0.00 0.00 \n", "78 6 W-6 P-10 27.08 11.77 10.46 30.84 \n", "79 6 W-6 P-11 33.26 11.80 0.00 0.00 \n", "80 6 W-6 P-12 27.17 9.17 0.00 0.00 \n", "\n", " L_Dens_Vote% Vote_Mayor% Vote_LastCity% Vote_Sen% \n", "69 34.42 63.98 24.95 94.37 \n", "70 46.34 70.58 32.99 96.09 \n", "71 29.28 61.47 29.89 90.95 \n", "72 26.61 58.20 26.40 86.60 \n", "73 25.80 59.90 24.74 86.01 \n", "74 23.86 57.78 20.22 86.68 \n", "75 15.68 62.42 27.39 82.80 \n", "76 18.41 59.69 28.12 78.44 \n", "77 24.79 53.58 21.80 89.68 \n", "78 26.31 61.31 29.56 91.24 \n", "79 33.31 51.14 24.17 91.24 \n", "80 26.95 53.11 24.22 93.17 " ] }, "execution_count": 45, "metadata": {}, "output_type": "execute_result" } ], "source": [ "P19.query('Ward==6')" ] }, { "cell_type": "code", "execution_count": 35, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "execution_count": 35, "metadata": {}, "output_type": "execute_result" } ], "source": [ "map_2019_SP_CityCouncilMayor_byPrecinct(6)" ] }, { "cell_type": "code", "execution_count": 36, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "execution_count": 36, "metadata": {}, "output_type": "execute_result" } ], "source": [ "map_2019_SP_CityCouncilLast_byPrecinct(6)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Ward 7 Precinct Analysis \n", "\n", "\"Drawing\"" ] }, { "cell_type": "code", "execution_count": 46, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
WardPrecinctTot_Vote%LastCity_Vote%H_Dens%H_Dens_Vote%L_Dens_Vote%Vote_Mayor%Vote_LastCity%Vote_Sen%
817W-7 P-121.249.325.7018.7020.8467.5631.3293.96
827W-7 P-220.085.690.000.0021.1050.1818.4190.97
837W-7 P-320.056.760.000.0020.1863.4922.2293.97
847W-7 P-419.968.3913.6014.8421.0362.1128.9595.79
857W-7 P-533.9618.7713.7424.6134.7869.8340.3097.20
867W-7 P-618.796.050.000.0019.7057.4916.3889.90
877W-7 P-717.557.8221.0617.0919.0157.2025.1090.95
887W-7 P-819.768.1911.274.5222.8661.0423.7194.28
897W-7 P-921.946.830.000.0023.5753.7620.1693.28
907W-7 P-1022.187.700.000.0023.8354.1822.7792.22
917W-7 P-1112.475.2321.4310.0713.6460.4823.3594.61
927W-7 P-1222.4610.3720.1111.6525.5466.7830.4095.85
937W-7 P-1331.6813.1022.5523.7435.7761.2130.5395.02
\n", "
" ], "text/plain": [ " Ward Precinct Tot_Vote% LastCity_Vote% H_Dens% H_Dens_Vote% \\\n", "81 7 W-7 P-1 21.24 9.32 5.70 18.70 \n", "82 7 W-7 P-2 20.08 5.69 0.00 0.00 \n", "83 7 W-7 P-3 20.05 6.76 0.00 0.00 \n", "84 7 W-7 P-4 19.96 8.39 13.60 14.84 \n", "85 7 W-7 P-5 33.96 18.77 13.74 24.61 \n", "86 7 W-7 P-6 18.79 6.05 0.00 0.00 \n", "87 7 W-7 P-7 17.55 7.82 21.06 17.09 \n", "88 7 W-7 P-8 19.76 8.19 11.27 4.52 \n", "89 7 W-7 P-9 21.94 6.83 0.00 0.00 \n", "90 7 W-7 P-10 22.18 7.70 0.00 0.00 \n", "91 7 W-7 P-11 12.47 5.23 21.43 10.07 \n", "92 7 W-7 P-12 22.46 10.37 20.11 11.65 \n", "93 7 W-7 P-13 31.68 13.10 22.55 23.74 \n", "\n", " L_Dens_Vote% Vote_Mayor% Vote_LastCity% Vote_Sen% \n", "81 20.84 67.56 31.32 93.96 \n", "82 21.10 50.18 18.41 90.97 \n", "83 20.18 63.49 22.22 93.97 \n", "84 21.03 62.11 28.95 95.79 \n", "85 34.78 69.83 40.30 97.20 \n", "86 19.70 57.49 16.38 89.90 \n", "87 19.01 57.20 25.10 90.95 \n", "88 22.86 61.04 23.71 94.28 \n", "89 23.57 53.76 20.16 93.28 \n", "90 23.83 54.18 22.77 92.22 \n", "91 13.64 60.48 23.35 94.61 \n", "92 25.54 66.78 30.40 95.85 \n", "93 35.77 61.21 30.53 95.02 " ] }, "execution_count": 46, "metadata": {}, "output_type": "execute_result" } ], "source": [ "P19.query('Ward==7')" ] }, { "cell_type": "code", "execution_count": 37, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "execution_count": 37, "metadata": {}, "output_type": "execute_result" } ], "source": [ "map_2019_SP_CityCouncilMayor_byPrecinct(7)" ] }, { "cell_type": "code", "execution_count": 38, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "execution_count": 38, "metadata": {}, "output_type": "execute_result" } ], "source": [ "map_2019_SP_CityCouncilLast_byPrecinct(7)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Concluding Thoughts/ Summary \n", "\n", "From this supplemental report, here are some of the highlights:\n", "* **Voter Registry:** It has increased in 2019 city council election, mostly toward younger voters\n", "* **Voter Age Distribution:** Compared to the 2015 city council election, the 2019 city council had even greater concentration of older voters (60-70).\n", "* **Voter Turnout Across Age:** It was very similar to that of the 2017 mayoral election. \n", "* **Percentage of Voters that also voted in Mayor’s election:** it ranged from 50% to 80% across precincts with west of Saint Paul having greater alignment \n", "* **Percentage of Voters that also voted in Last City Council election:** it ranged from 15% to 60% across precincts which is considerably lower than the citizens that vote in the mayor. Note, this should be expected since the overall voter turnout has increased\n", "* **Percentage of Voters that also voted in Senate’s election:** it ranged from 90% to 98% across Wards; indicating not that many new voters came.\n", "* **Youth Vote% (Age 18-21):** it’s around 10% for the city. However, it does not consider the potential total registered vote count which may double for the upcoming presidential election\n", "* **Density Metrics:** There is voter turnout discrepancy between high density and low density residents. From the map, we see the wealthier precincts have low-density residents voting more frequently than the high-density residents. In ward 3, there was a difference of 26% points with low density residents voting more frequently. \n", "* **Etymology Metrics:** Ethnic minorities follow more closely to the population demographics, while more traditional Americans have older people voting in much greater proportion. For the East/SouthEast Asian category, the youth voting rate is the same as the average population, but there is a voting participation gap for older voters.\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Run Code (Prior to running report) " ] }, { "cell_type": "code", "execution_count": 62, "metadata": {}, "outputs": [], "source": [ "#Run Code\n", "import pandas as pd\n", "import numpy as np\n", "import warnings\n", "warnings.filterwarnings('ignore')\n", "import matplotlib as mpl\n", "import matplotlib.pyplot as plt\n", "%matplotlib inline \n", "import requests # library to handle requests\n", "import folium\n", "import seaborn as sns\n", "import scipy.stats as stats #used to get correlation coefficient\n", "\n", "#load data\n", "P_19= pd.read_csv('Data/2019Data/2019Precinct_Complete.csv')\n", "P_19['H_Dens']= P_19['H_Density%']\n", "Features= ['Ward','Precinct1', 'Tot_Vote%','LastCouncil_Vote%', 'H_Density%', 'H_Density_Vote%', 'L_Density_Vote%', 'Vote_Mayor%', 'Vote_LastCity%', 'Vote_Senate%']\n", "P19= P_19[Features]\n", "P19.columns= ['Ward','Precinct', 'Tot_Vote%','LastCity_Vote%', 'H_Dens%', 'H_Dens_Vote%', 'L_Dens_Vote%', 'Vote_Mayor%', 'Vote_LastCity%', 'Vote_Sen%']\n", "\n", "Features= ['Ward','Precinct', 'H_Density%', 'Density_VoteDiff%', 'H_Dens']\n", "PP= P_19[Features]\n", "\n", "# Vote Maoor\n", "def map_2019_SP_CityCouncilMayor_byPrecinct(Ward=0):\n", " #setup\n", " sp_geo = r'Shapefiles/SaintPaul_VotingPrecincts.json'\n", " \n", " if Ward==0:\n", " B=P_19 \n", " A='City Council'\n", " zo= 12\n", " else: \n", " B= P_19[(P_19['Ward'] == Ward)]\n", " A= 'Ward ' + str(Ward) +' '\n", " zo=13\n", " \n", " #Set up Variable Zoom Locations\n", " data = [[0, [44.948530, -93.096058]], [1, [44.958326, -93.122926]], [2, [44.933159, -93.115535]], [3, [44.918270, -93.176131]], [4, [44.961494, -93.176991]], [5, [44.978117, -93.106602]], [6, [44.978945, -93.047281]], [7, [44.942040, -93.033178]]] \n", "\n", " #44.951655, -93.096323\n", " \n", " # Create the pandas DataFrame \n", " Loc = pd.DataFrame(data, columns = ['Ward', 'Location']) \n", " Loc.iloc[Ward,1:]\n", " \n", " \n", " # generate a new map\n", " SP_map = folium.Map(location=Loc.iloc[Ward,1], zoom_start=zo,tiles='Stamen Terrain') #tiles=\"OpenStreetMap\")\n", "\n", " SP_map.choropleth(\n", " geo_data=sp_geo,\n", " data=B,\n", " columns=['Precinct','Vote_Mayor%'],\n", " key_on=\"feature.properties.Precinct\",\n", " fill_color='YlOrRd', \n", " fill_opacity=0.7, \n", " line_opacity=0.2,\n", " legend_name='2019 Saint Paul ' + A +' Voter% that voted in 2017 Mayor: 11/10/19',\n", " highlight= True\n", " )\n", " \n", " # display map\n", " return SP_map\n", "\n", "#council last\n", "\n", "def map_2019_SP_CityCouncilLast_byPrecinct(Ward=0):\n", " #setup\n", " sp_geo = r'Shapefiles/SaintPaul_VotingPrecincts.json'\n", " \n", " if Ward==0:\n", " B=P_19 \n", " A='City Council'\n", " zo= 12\n", " else: \n", " B= P_19[(P_19['Ward'] == Ward)]\n", " A= 'Ward ' + str(Ward) +' '\n", " zo=13\n", " \n", " #Set up Variable Zoom Locations\n", " data = [[0, [44.948530, -93.096058]], [1, [44.958326, -93.122926]], [2, [44.933159, -93.115535]], [3, [44.918270, -93.176131]], [4, [44.961494, -93.176991]], [5, [44.978117, -93.106602]], [6, [44.978945, -93.047281]], [7, [44.942040, -93.033178]]] \n", "\n", " #44.951655, -93.096323\n", " \n", " # Create the pandas DataFrame \n", " Loc = pd.DataFrame(data, columns = ['Ward', 'Location']) \n", " Loc.iloc[Ward,1:]\n", " \n", " \n", " # generate a new map\n", " SP_map = folium.Map(location=Loc.iloc[Ward,1], zoom_start=zo,tiles='Stamen Terrain') #tiles=\"OpenStreetMap\")\n", "\n", " SP_map.choropleth(\n", " geo_data=sp_geo,\n", " data=B,\n", " columns=['Precinct','Vote_LastCity%'],\n", " key_on=\"feature.properties.Precinct\",\n", " fill_color='YlOrRd', \n", " fill_opacity=0.7, \n", " line_opacity=0.2,\n", " legend_name='2019 Saint Paul ' + A +' Voter% that voted in 2015 city council: 11/10/19',\n", " highlight= True\n", " )\n", " \n", " # display map\n", " return SP_map\n", "\n", "#High Density Percentage\n", "\n", "def map_2019_SP_CityCouncilDensity_byPrecinct(Ward=0):\n", " #setup\n", " sp_geo = r'Shapefiles/SaintPaul_VotingPrecincts.json'\n", " \n", " if Ward==0:\n", " B=P_19.query('H_Dens >0')\n", " zo= 12\n", " else: \n", " B= P_19[(P_19['Ward'] == Ward)]\n", " zo=13\n", " \n", " #Set up Variable Zoom Locations\n", " data = [[0, [44.948530, -93.096058]], [1, [44.958326, -93.122926]], [2, [44.933159, -93.115535]], [3, [44.918270, -93.176131]], [4, [44.961494, -93.176991]], [5, [44.978117, -93.106602]], [6, [44.978945, -93.047281]], [7, [44.942040, -93.033178]]] \n", "\n", " #44.951655, -93.096323\n", " \n", " # Create the pandas DataFrame \n", " Loc = pd.DataFrame(data, columns = ['Ward', 'Location']) \n", " Loc.iloc[Ward,1:]\n", " \n", " \n", " # generate a new map\n", " SP_map = folium.Map(location=Loc.iloc[Ward,1], zoom_start=zo,tiles='Stamen Terrain') #tiles=\"OpenStreetMap\")\n", "\n", " SP_map.choropleth(\n", " geo_data=sp_geo,\n", " data=B,\n", " columns=['Precinct','H_Density%'],\n", " key_on=\"feature.properties.Precinct\",\n", " fill_color='YlOrRd', \n", " fill_opacity=0.7, \n", " line_opacity=0.2,\n", " legend_name='2019 Saint Paul High density registered voter%: 11/10/19',\n", " highlight= True\n", " )\n", " \n", " # display map\n", " return SP_map\n", "\n", "\n", "#High Density Percentage\n", "\n", "def map_2019_SP_CityCouncilDensityDiff_byPrecinct(Ward=0):\n", " #setup\n", " sp_geo = r'Shapefiles/SaintPaul_VotingPrecincts.json'\n", " \n", " if Ward==0:\n", " B=PP.query('H_Dens >5')\n", " A='City Council'\n", " zo= 12\n", " else: \n", " B= PP[(PP['Ward'] == Ward)]\n", " A= 'Ward ' + str(Ward) +' '\n", " zo=13\n", " \n", " #Set up Variable Zoom Locations\n", " data = [[0, [44.948530, -93.096058]], [1, [44.958326, -93.122926]], [2, [44.933159, -93.115535]], [3, [44.918270, -93.176131]], [4, [44.961494, -93.176991]], [5, [44.978117, -93.106602]], [6, [44.978945, -93.047281]], [7, [44.942040, -93.033178]]] \n", "\n", " #44.951655, -93.096323\n", " \n", " # Create the pandas DataFrame \n", " Loc = pd.DataFrame(data, columns = ['Ward', 'Location']) \n", " Loc.iloc[Ward,1:]\n", " \n", " \n", " # generate a new map\n", " SP_map = folium.Map(location=Loc.iloc[Ward,1], zoom_start=zo,tiles='Stamen Terrain') #tiles=\"OpenStreetMap\")\n", "\n", " SP_map.choropleth(\n", " geo_data=sp_geo,\n", " data=B,\n", " columns=['Precinct','Density_VoteDiff%'],\n", " key_on=\"feature.properties.Precinct\",\n", " fill_color='YlOrRd', \n", " fill_opacity=0.7, \n", " line_opacity=0.2,\n", " legend_name='2019 Saint Paul ' + A +' Density Vote% Difference: 11/10/19',\n", " highlight= True\n", " )\n", " \n", " # display map\n", " return SP_map\n", "\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "[Click to go to Table of Contents](#content)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.3" } }, "nbformat": 4, "nbformat_minor": 2 }