{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
\n",
"
Saint Paul (MN) City Council Election Voting Report [Data Only]:
\n",
" The Case for Systemic Voter Suppression; 07/31/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/ Ward Votes](#youth)\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",
" * \n",
"* [NEXT STEPS!](#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 2015 Saint Paul city council elections as well to illustrate systemic inequities. 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. To view the full report with analysis. [Click here.](https://nbviewer.jupyter.org/github/sustainabu/OpenData_Saint_Paul/blob/master/_Saint%20Paul%20City%20Council%20Election%20Analysis/Saint%20Paul%202015%20City%20Council%20Voting%20Report_06-24-19.ipynb)\n",
"\n",
"1. **Data Analysis [Informational]**: Include voting rate for different elections, Ward analysis, Youth voter rate, and Precinct fragmentation analysis\n",
"\n",
"**Disclaimer:** I am running for Saint Paul city council for Ward 1 (election on November 5th, 2019). One core feature of the Citizen-First campaign is to educate citizens about current systemic inequities and local issues so we can work on them together. I have decided to create an open data report for **_all of Saint Paul (not just my Ward)_**, so citizens and candidates throughout the city have discussions on systematic voter suppression, and take active actions in addressing it. Please take the time to read, and be part of the solution. Power to the people. #power2people\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. Who benefits from the current system and who doesn't? \n",
"3. What can we do about it?\n",
"\n",
"Here are some FACTS (i.e. data results) from the 2015 City Council Elections to get you motivated to read further\n",
"\n",
"\n",
"\n",
"* During the last presidential election, registered voter turnout was 78%, while the 2015 city council election ranged from 9% to 18%.\n",
"* Despite younger adults being the largest demographic, it is the senior citizens who vote disproportionately more. \n",
"* The 18-20 age group voting percentage of the 2015 city council election is 1% \n",
"* 18 out of 95 precincts are under-respresentated (greater than 2% points). See Map Below\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
""
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"map_2015_SP_CityCouncilRepresentation_byPrecinct()"
]
},
{
"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 6/24/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. In addition, I got geojson file for my map [here](https://www.sos.state.mn.us/election-administration-campaigns/data-maps/geojson-files/)\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 to 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, which will be used for comparison.\n",
"\n",
"The last four more major elections in Saint Paul:\n",
"\n",
"* 2018: Governor, Senator\n",
"* 2017: Mayor\n",
"* 2016: Presidential \n",
"* 2015: City Council\n",
"\n",
"All of these governmental bodies are interconnected providing services/representing citizens directly. Within Saint Paul’s Ward 1, there are 4 state representatives, 3 county commissioners, and 3 state senators. In other words, there is considerable overlap between agencies based on living location. The Saint Paul city council is the legislative board of the city, totaling 7 council members for each Ward, which holds roughly 41,000 people respectively. The ward can be further broken down even further into non-elected district planning councils that represent neighborhoods areas, and serve an essential role for the city's comprehensive development plan. \n",
"\n",
"\n",
"\n",
"From the map above, we can see there is potential **fragmentation**, where certain pockets of a neighborhood may be isolated. I will be implementing a precinct analysis, to find which precincts are under-represented compared to surrounding precincts in the ward. \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.\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",
"\n",
"\n",
"\n",
"\n",
"When plotting the age distribution of each wards in Saint Paul, Ward 3 differed considerably from all the other wards as demonstrated below. \n",
"\n",
"\n",
"\n",
"Finally, if we break down voter registration by ward, we see that Ward 3 has the most registered voters with around 50% more registered voters than Ward 5 & 6 respectively. Ward 3 has considerable influence in impacting the mayor election. \n",
"\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Voting Trends: \n",
"\n",
"As explained in the Background section, local elections are only during the odd years. As many would expect, the turnout is low for local elections\n",
"\n",
"\n",
"\n",
"The following graph below compares participation on city council election of Saint Paul and Minneapolis.\n",
"\n",
"\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 Minneapolis has considerable voter turnout for their local election, which is probably directly related to having the mayoral and city council election at the same time.\n",
"\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Ward/Youth Vote: \n",
" \n",
"From the following tables below we see the voting and youth participation significantly less for the city council election in comparison to the presidential election. The competitive wards, highlighted in yellow, have greater voter turnout. Though Ward 3 had a moderate turnout despite not being a competitive race. Note: I used Google Sheet because it has conditional color formating. \n",
"\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Precinct Analysis: Fragmentation \n",
"\n",
"The maps have considerable implications, so I will explain the methodology in more detail. This calculations assumes that each precinct should vote at equal rate in comparison to neighboring precincts. For each precinct, I create three column calculations:\n",
"\n",
"* **Projected Weight:** (The total registered voters on precinct) / (The total registered voters within Ward)\n",
"* **Actual Weight:** (The total actual votes on precinct) / (The total actual voters within Ward)\n",
"* **Representation:** (Actual Weight) - (Projected Weight)\n",
"\n",
"Ideally, the projected weight and actual weight should be near zero across precincts, so pay attention to the range of participation in the maps below. A precinct can be over-represented because a certain precinct votes in greater frequency than other precincts and/or precincts have been excluded from participation. Finally, there is typically less registered voters in lower-income and immigrant communities. If we incorporate this, the projected weights for those precincts will be greater and the **_under-representation is higher_** in those precincts than displayed. \n",
"\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Ward 1 Precinct Analysis \n",
"\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Ward | \n",
" Precinct | \n",
" Tot_Vote | \n",
" Tot_Reg | \n",
" Vote% | \n",
" H_Dens% | \n",
" H_Dens_Vote% | \n",
" L_Dens_Vote% | \n",
" Pro_Weight | \n",
" Act_Weight | \n",
" Representation | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 1.0 | \n",
" Saint Paul W-1 P-1 | \n",
" 279.0 | \n",
" 1126 | \n",
" 24.78 | \n",
" 15.54 | \n",
" 10.29 | \n",
" 27.44 | \n",
" 5.43 | \n",
" 10.58 | \n",
" 5.15 | \n",
"
\n",
" \n",
" 1 | \n",
" 1.0 | \n",
" Saint Paul W-1 P-10 | \n",
" 35.0 | \n",
" 442 | \n",
" 7.92 | \n",
" 15.16 | \n",
" 5.97 | \n",
" 8.27 | \n",
" 2.13 | \n",
" 1.33 | \n",
" -0.80 | \n",
"
\n",
" \n",
" 2 | \n",
" 1.0 | \n",
" Saint Paul W-1 P-11 | \n",
" 123.0 | \n",
" 1067 | \n",
" 11.53 | \n",
" 42.36 | \n",
" 12.83 | \n",
" 10.57 | \n",
" 5.15 | \n",
" 4.66 | \n",
" -0.49 | \n",
"
\n",
" \n",
" 3 | \n",
" 1.0 | \n",
" Saint Paul W-1 P-12 | \n",
" 66.0 | \n",
" 328 | \n",
" 20.12 | \n",
" 32.32 | \n",
" 14.15 | \n",
" 22.97 | \n",
" 1.58 | \n",
" 2.50 | \n",
" 0.92 | \n",
"
\n",
" \n",
" 4 | \n",
" 1.0 | \n",
" Saint Paul W-1 P-13 | \n",
" 175.0 | \n",
" 1135 | \n",
" 15.42 | \n",
" 27.05 | \n",
" 10.10 | \n",
" 17.39 | \n",
" 5.47 | \n",
" 6.64 | \n",
" 1.17 | \n",
"
\n",
" \n",
" 5 | \n",
" 1.0 | \n",
" Saint Paul W-1 P-14 | \n",
" 126.0 | \n",
" 925 | \n",
" 13.62 | \n",
" 28.65 | \n",
" 24.91 | \n",
" 9.09 | \n",
" 4.46 | \n",
" 4.78 | \n",
" 0.32 | \n",
"
\n",
" \n",
" 6 | \n",
" 1.0 | \n",
" Saint Paul W-1 P-15 | \n",
" 37.0 | \n",
" 700 | \n",
" 5.29 | \n",
" 11.57 | \n",
" 6.17 | \n",
" 5.17 | \n",
" 3.38 | \n",
" 1.40 | \n",
" -1.98 | \n",
"
\n",
" \n",
" 7 | \n",
" 1.0 | \n",
" Saint Paul W-1 P-16 | \n",
" 31.0 | \n",
" 235 | \n",
" 13.19 | \n",
" 8.51 | \n",
" 0.00 | \n",
" 14.42 | \n",
" 1.13 | \n",
" 1.18 | \n",
" 0.05 | \n",
"
\n",
" \n",
" 8 | \n",
" 1.0 | \n",
" Saint Paul W-1 P-2 | \n",
" 268.0 | \n",
" 2046 | \n",
" 13.10 | \n",
" 32.70 | \n",
" 6.43 | \n",
" 16.34 | \n",
" 9.87 | \n",
" 10.16 | \n",
" 0.29 | \n",
"
\n",
" \n",
" 9 | \n",
" 1.0 | \n",
" Saint Paul W-1 P-3 | \n",
" 174.0 | \n",
" 1792 | \n",
" 9.71 | \n",
" 9.88 | \n",
" 1.69 | \n",
" 10.59 | \n",
" 8.64 | \n",
" 6.60 | \n",
" -2.04 | \n",
"
\n",
" \n",
" 10 | \n",
" 1.0 | \n",
" Saint Paul W-1 P-4 | \n",
" 137.0 | \n",
" 1296 | \n",
" 10.57 | \n",
" 1.39 | \n",
" 5.56 | \n",
" 10.64 | \n",
" 6.25 | \n",
" 5.20 | \n",
" -1.05 | \n",
"
\n",
" \n",
" 11 | \n",
" 1.0 | \n",
" Saint Paul W-1 P-5 | \n",
" 144.0 | \n",
" 1275 | \n",
" 11.29 | \n",
" 6.67 | \n",
" 4.71 | \n",
" 11.76 | \n",
" 6.15 | \n",
" 5.46 | \n",
" -0.69 | \n",
"
\n",
" \n",
" 12 | \n",
" 1.0 | \n",
" Saint Paul W-1 P-6 | \n",
" 331.0 | \n",
" 2645 | \n",
" 12.51 | \n",
" 9.72 | \n",
" 8.17 | \n",
" 12.98 | \n",
" 12.75 | \n",
" 12.55 | \n",
" -0.20 | \n",
"
\n",
" \n",
" 13 | \n",
" 1.0 | \n",
" Saint Paul W-1 P-7 | \n",
" 264.0 | \n",
" 1444 | \n",
" 18.28 | \n",
" 15.72 | \n",
" 3.96 | \n",
" 20.95 | \n",
" 6.96 | \n",
" 10.01 | \n",
" 3.05 | \n",
"
\n",
" \n",
" 14 | \n",
" 1.0 | \n",
" Saint Paul W-1 P-8 | \n",
" 269.0 | \n",
" 2104 | \n",
" 12.79 | \n",
" 53.99 | \n",
" 10.48 | \n",
" 15.50 | \n",
" 10.15 | \n",
" 10.20 | \n",
" 0.05 | \n",
"
\n",
" \n",
" 15 | \n",
" 1.0 | \n",
" Saint Paul W-1 P-9 | \n",
" 178.0 | \n",
" 2177 | \n",
" 8.18 | \n",
" 12.17 | \n",
" 4.53 | \n",
" 8.68 | \n",
" 10.50 | \n",
" 6.75 | \n",
" -3.75 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Ward Precinct Tot_Vote Tot_Reg Vote% H_Dens% \\\n",
"0 1.0 Saint Paul W-1 P-1 279.0 1126 24.78 15.54 \n",
"1 1.0 Saint Paul W-1 P-10 35.0 442 7.92 15.16 \n",
"2 1.0 Saint Paul W-1 P-11 123.0 1067 11.53 42.36 \n",
"3 1.0 Saint Paul W-1 P-12 66.0 328 20.12 32.32 \n",
"4 1.0 Saint Paul W-1 P-13 175.0 1135 15.42 27.05 \n",
"5 1.0 Saint Paul W-1 P-14 126.0 925 13.62 28.65 \n",
"6 1.0 Saint Paul W-1 P-15 37.0 700 5.29 11.57 \n",
"7 1.0 Saint Paul W-1 P-16 31.0 235 13.19 8.51 \n",
"8 1.0 Saint Paul W-1 P-2 268.0 2046 13.10 32.70 \n",
"9 1.0 Saint Paul W-1 P-3 174.0 1792 9.71 9.88 \n",
"10 1.0 Saint Paul W-1 P-4 137.0 1296 10.57 1.39 \n",
"11 1.0 Saint Paul W-1 P-5 144.0 1275 11.29 6.67 \n",
"12 1.0 Saint Paul W-1 P-6 331.0 2645 12.51 9.72 \n",
"13 1.0 Saint Paul W-1 P-7 264.0 1444 18.28 15.72 \n",
"14 1.0 Saint Paul W-1 P-8 269.0 2104 12.79 53.99 \n",
"15 1.0 Saint Paul W-1 P-9 178.0 2177 8.18 12.17 \n",
"\n",
" H_Dens_Vote% L_Dens_Vote% Pro_Weight Act_Weight Representation \n",
"0 10.29 27.44 5.43 10.58 5.15 \n",
"1 5.97 8.27 2.13 1.33 -0.80 \n",
"2 12.83 10.57 5.15 4.66 -0.49 \n",
"3 14.15 22.97 1.58 2.50 0.92 \n",
"4 10.10 17.39 5.47 6.64 1.17 \n",
"5 24.91 9.09 4.46 4.78 0.32 \n",
"6 6.17 5.17 3.38 1.40 -1.98 \n",
"7 0.00 14.42 1.13 1.18 0.05 \n",
"8 6.43 16.34 9.87 10.16 0.29 \n",
"9 1.69 10.59 8.64 6.60 -2.04 \n",
"10 5.56 10.64 6.25 5.20 -1.05 \n",
"11 4.71 11.76 6.15 5.46 -0.69 \n",
"12 8.17 12.98 12.75 12.55 -0.20 \n",
"13 3.96 20.95 6.96 10.01 3.05 \n",
"14 10.48 15.50 10.15 10.20 0.05 \n",
"15 4.53 8.68 10.50 6.75 -3.75 "
]
},
"execution_count": 30,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"P_15.query('Ward==1')"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
""
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"map_2015_SP_CityCouncilRepresentation_byPrecinct(1)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Ward 2 Precinct Analysis (Competitive) \n",
"\n",
"\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": 28,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Ward | \n",
" Precinct | \n",
" Tot_Vote | \n",
" Tot_Reg | \n",
" Vote% | \n",
" H_Dens% | \n",
" H_Dens_Vote% | \n",
" L_Dens_Vote% | \n",
" Pro_Weight | \n",
" Act_Weight | \n",
" Representation | \n",
"
\n",
" \n",
" \n",
" \n",
" 16 | \n",
" 2.0 | \n",
" Saint Paul W-2 P-1 | \n",
" 434.0 | \n",
" 1571 | \n",
" 27.63 | \n",
" 18.97 | \n",
" 6.71 | \n",
" 32.52 | \n",
" 6.04 | \n",
" 8.89 | \n",
" 2.85 | \n",
"
\n",
" \n",
" 17 | \n",
" 2.0 | \n",
" Saint Paul W-2 P-11 | \n",
" 351.0 | \n",
" 2841 | \n",
" 12.35 | \n",
" 99.16 | \n",
" 12.21 | \n",
" 29.17 | \n",
" 10.93 | \n",
" 7.19 | \n",
" -3.74 | \n",
"
\n",
" \n",
" 18 | \n",
" 2.0 | \n",
" Saint Paul W-2 P-13 | \n",
" 347.0 | \n",
" 1500 | \n",
" 23.13 | \n",
" 23.67 | \n",
" 15.77 | \n",
" 25.41 | \n",
" 5.77 | \n",
" 7.10 | \n",
" 1.33 | \n",
"
\n",
" \n",
" 19 | \n",
" 2.0 | \n",
" Saint Paul W-2 P-14 | \n",
" 304.0 | \n",
" 1669 | \n",
" 18.21 | \n",
" 5.03 | \n",
" 5.95 | \n",
" 18.86 | \n",
" 6.42 | \n",
" 6.22 | \n",
" -0.20 | \n",
"
\n",
" \n",
" 20 | \n",
" 2.0 | \n",
" Saint Paul W-2 P-15 | \n",
" 290.0 | \n",
" 2574 | \n",
" 11.27 | \n",
" 12.74 | \n",
" 8.23 | \n",
" 11.71 | \n",
" 9.90 | \n",
" 5.94 | \n",
" -3.96 | \n",
"
\n",
" \n",
" 21 | \n",
" 2.0 | \n",
" Saint Paul W-2 P-2 | \n",
" 450.0 | \n",
" 1653 | \n",
" 27.22 | \n",
" 16.82 | \n",
" 11.15 | \n",
" 30.47 | \n",
" 6.36 | \n",
" 9.21 | \n",
" 2.85 | \n",
"
\n",
" \n",
" 22 | \n",
" 2.0 | \n",
" Saint Paul W-2 P-3 | \n",
" 446.0 | \n",
" 2571 | \n",
" 17.35 | \n",
" 22.36 | \n",
" 5.04 | \n",
" 20.89 | \n",
" 9.89 | \n",
" 9.13 | \n",
" -0.76 | \n",
"
\n",
" \n",
" 23 | \n",
" 2.0 | \n",
" Saint Paul W-2 P-4 | \n",
" 298.0 | \n",
" 1519 | \n",
" 19.62 | \n",
" 30.48 | \n",
" 8.86 | \n",
" 24.34 | \n",
" 5.84 | \n",
" 6.10 | \n",
" 0.26 | \n",
"
\n",
" \n",
" 24 | \n",
" 2.0 | \n",
" Saint Paul W-2 P-5 | \n",
" 524.0 | \n",
" 2323 | \n",
" 22.56 | \n",
" 15.80 | \n",
" 10.35 | \n",
" 24.85 | \n",
" 8.93 | \n",
" 10.73 | \n",
" 1.80 | \n",
"
\n",
" \n",
" 25 | \n",
" 2.0 | \n",
" Saint Paul W-2 P-6 | \n",
" 104.0 | \n",
" 603 | \n",
" 17.25 | \n",
" 73.80 | \n",
" 15.73 | \n",
" 21.52 | \n",
" 2.32 | \n",
" 2.13 | \n",
" -0.19 | \n",
"
\n",
" \n",
" 26 | \n",
" 2.0 | \n",
" Saint Paul W-2 P-7 | \n",
" 375.0 | \n",
" 2194 | \n",
" 17.09 | \n",
" 50.96 | \n",
" 10.20 | \n",
" 24.26 | \n",
" 8.44 | \n",
" 7.68 | \n",
" -0.76 | \n",
"
\n",
" \n",
" 27 | \n",
" 2.0 | \n",
" Saint Paul W-2 P-8 | \n",
" 157.0 | \n",
" 1211 | \n",
" 12.96 | \n",
" 83.24 | \n",
" 12.00 | \n",
" 17.73 | \n",
" 4.66 | \n",
" 3.21 | \n",
" -1.45 | \n",
"
\n",
" \n",
" 28 | \n",
" 2.0 | \n",
" Saint Paul W-2 P-9 | \n",
" 367.0 | \n",
" 1998 | \n",
" 18.37 | \n",
" 95.80 | \n",
" 18.55 | \n",
" 14.29 | \n",
" 7.68 | \n",
" 7.51 | \n",
" -0.17 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Ward Precinct Tot_Vote Tot_Reg Vote% H_Dens% \\\n",
"16 2.0 Saint Paul W-2 P-1 434.0 1571 27.63 18.97 \n",
"17 2.0 Saint Paul W-2 P-11 351.0 2841 12.35 99.16 \n",
"18 2.0 Saint Paul W-2 P-13 347.0 1500 23.13 23.67 \n",
"19 2.0 Saint Paul W-2 P-14 304.0 1669 18.21 5.03 \n",
"20 2.0 Saint Paul W-2 P-15 290.0 2574 11.27 12.74 \n",
"21 2.0 Saint Paul W-2 P-2 450.0 1653 27.22 16.82 \n",
"22 2.0 Saint Paul W-2 P-3 446.0 2571 17.35 22.36 \n",
"23 2.0 Saint Paul W-2 P-4 298.0 1519 19.62 30.48 \n",
"24 2.0 Saint Paul W-2 P-5 524.0 2323 22.56 15.80 \n",
"25 2.0 Saint Paul W-2 P-6 104.0 603 17.25 73.80 \n",
"26 2.0 Saint Paul W-2 P-7 375.0 2194 17.09 50.96 \n",
"27 2.0 Saint Paul W-2 P-8 157.0 1211 12.96 83.24 \n",
"28 2.0 Saint Paul W-2 P-9 367.0 1998 18.37 95.80 \n",
"\n",
" H_Dens_Vote% L_Dens_Vote% Pro_Weight Act_Weight Representation \n",
"16 6.71 32.52 6.04 8.89 2.85 \n",
"17 12.21 29.17 10.93 7.19 -3.74 \n",
"18 15.77 25.41 5.77 7.10 1.33 \n",
"19 5.95 18.86 6.42 6.22 -0.20 \n",
"20 8.23 11.71 9.90 5.94 -3.96 \n",
"21 11.15 30.47 6.36 9.21 2.85 \n",
"22 5.04 20.89 9.89 9.13 -0.76 \n",
"23 8.86 24.34 5.84 6.10 0.26 \n",
"24 10.35 24.85 8.93 10.73 1.80 \n",
"25 15.73 21.52 2.32 2.13 -0.19 \n",
"26 10.20 24.26 8.44 7.68 -0.76 \n",
"27 12.00 17.73 4.66 3.21 -1.45 \n",
"28 18.55 14.29 7.68 7.51 -0.17 "
]
},
"execution_count": 28,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"P_15.query('Ward==2')"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
""
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"map_2015_SP_CityCouncilRepresentation_byPrecinct(2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Ward 3 Precinct Analysis \n",
"\n",
""
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Ward | \n",
" Precinct | \n",
" Tot_Vote | \n",
" Tot_Reg | \n",
" Vote% | \n",
" H_Dens% | \n",
" H_Dens_Vote% | \n",
" L_Dens_Vote% | \n",
" Pro_Weight | \n",
" Act_Weight | \n",
" Representation | \n",
"
\n",
" \n",
" \n",
" \n",
" 29 | \n",
" 3.0 | \n",
" Saint Paul W-3 P-1 | \n",
" 399.0 | \n",
" 1986 | \n",
" 20.09 | \n",
" 3.37 | \n",
" 5.97 | \n",
" 20.58 | \n",
" 7.19 | \n",
" 8.08 | \n",
" 0.89 | \n",
"
\n",
" \n",
" 30 | \n",
" 3.0 | \n",
" Saint Paul W-3 P-10 | \n",
" 257.0 | \n",
" 1446 | \n",
" 17.77 | \n",
" 4.98 | \n",
" 2.78 | \n",
" 18.56 | \n",
" 5.24 | \n",
" 5.20 | \n",
" -0.04 | \n",
"
\n",
" \n",
" 31 | \n",
" 3.0 | \n",
" Saint Paul W-3 P-11 | \n",
" 157.0 | \n",
" 1909 | \n",
" 8.22 | \n",
" 70.46 | \n",
" 9.96 | \n",
" 4.08 | \n",
" 6.91 | \n",
" 3.18 | \n",
" -3.73 | \n",
"
\n",
" \n",
" 32 | \n",
" 3.0 | \n",
" Saint Paul W-3 P-12 | \n",
" 330.0 | \n",
" 1745 | \n",
" 18.91 | \n",
" 12.66 | \n",
" 2.26 | \n",
" 21.33 | \n",
" 6.32 | \n",
" 6.68 | \n",
" 0.36 | \n",
"
\n",
" \n",
" 33 | \n",
" 3.0 | \n",
" Saint Paul W-3 P-13 | \n",
" 389.0 | \n",
" 1812 | \n",
" 21.47 | \n",
" 19.92 | \n",
" 19.67 | \n",
" 21.92 | \n",
" 6.56 | \n",
" 7.88 | \n",
" 1.32 | \n",
"
\n",
" \n",
" 34 | \n",
" 3.0 | \n",
" Saint Paul W-3 P-14 | \n",
" 656.0 | \n",
" 3516 | \n",
" 18.66 | \n",
" 6.14 | \n",
" 24.07 | \n",
" 18.30 | \n",
" 12.73 | \n",
" 13.28 | \n",
" 0.55 | \n",
"
\n",
" \n",
" 35 | \n",
" 3.0 | \n",
" Saint Paul W-3 P-2 | \n",
" 522.0 | \n",
" 2411 | \n",
" 21.65 | \n",
" 7.18 | \n",
" 5.78 | \n",
" 22.88 | \n",
" 8.73 | \n",
" 10.57 | \n",
" 1.84 | \n",
"
\n",
" \n",
" 36 | \n",
" 3.0 | \n",
" Saint Paul W-3 P-3 | \n",
" 413.0 | \n",
" 2655 | \n",
" 15.56 | \n",
" 23.05 | \n",
" 9.64 | \n",
" 17.33 | \n",
" 9.62 | \n",
" 8.36 | \n",
" -1.26 | \n",
"
\n",
" \n",
" 37 | \n",
" 3.0 | \n",
" Saint Paul W-3 P-4 | \n",
" 281.0 | \n",
" 1216 | \n",
" 23.11 | \n",
" 36.92 | \n",
" 21.60 | \n",
" 23.99 | \n",
" 4.40 | \n",
" 5.69 | \n",
" 1.29 | \n",
"
\n",
" \n",
" 38 | \n",
" 3.0 | \n",
" Saint Paul W-3 P-5 | \n",
" 261.0 | \n",
" 1901 | \n",
" 13.73 | \n",
" 55.44 | \n",
" 12.71 | \n",
" 14.99 | \n",
" 6.88 | \n",
" 5.28 | \n",
" -1.60 | \n",
"
\n",
" \n",
" 39 | \n",
" 3.0 | \n",
" Saint Paul W-3 P-6 | \n",
" 339.0 | \n",
" 2093 | \n",
" 16.20 | \n",
" 9.56 | \n",
" 7.00 | \n",
" 17.17 | \n",
" 7.58 | \n",
" 6.86 | \n",
" -0.72 | \n",
"
\n",
" \n",
" 40 | \n",
" 3.0 | \n",
" Saint Paul W-3 P-7 | \n",
" 178.0 | \n",
" 933 | \n",
" 19.08 | \n",
" 31.83 | \n",
" 8.42 | \n",
" 24.06 | \n",
" 3.38 | \n",
" 3.60 | \n",
" 0.22 | \n",
"
\n",
" \n",
" 41 | \n",
" 3.0 | \n",
" Saint Paul W-3 P-8 | \n",
" 319.0 | \n",
" 1546 | \n",
" 20.63 | \n",
" 5.37 | \n",
" 1.20 | \n",
" 21.74 | \n",
" 5.60 | \n",
" 6.46 | \n",
" 0.86 | \n",
"
\n",
" \n",
" 42 | \n",
" 3.0 | \n",
" Saint Paul W-3 P-9 | \n",
" 438.0 | \n",
" 2443 | \n",
" 17.93 | \n",
" 15.23 | \n",
" 9.68 | \n",
" 19.41 | \n",
" 8.85 | \n",
" 8.87 | \n",
" 0.02 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Ward Precinct Tot_Vote Tot_Reg Vote% H_Dens% \\\n",
"29 3.0 Saint Paul W-3 P-1 399.0 1986 20.09 3.37 \n",
"30 3.0 Saint Paul W-3 P-10 257.0 1446 17.77 4.98 \n",
"31 3.0 Saint Paul W-3 P-11 157.0 1909 8.22 70.46 \n",
"32 3.0 Saint Paul W-3 P-12 330.0 1745 18.91 12.66 \n",
"33 3.0 Saint Paul W-3 P-13 389.0 1812 21.47 19.92 \n",
"34 3.0 Saint Paul W-3 P-14 656.0 3516 18.66 6.14 \n",
"35 3.0 Saint Paul W-3 P-2 522.0 2411 21.65 7.18 \n",
"36 3.0 Saint Paul W-3 P-3 413.0 2655 15.56 23.05 \n",
"37 3.0 Saint Paul W-3 P-4 281.0 1216 23.11 36.92 \n",
"38 3.0 Saint Paul W-3 P-5 261.0 1901 13.73 55.44 \n",
"39 3.0 Saint Paul W-3 P-6 339.0 2093 16.20 9.56 \n",
"40 3.0 Saint Paul W-3 P-7 178.0 933 19.08 31.83 \n",
"41 3.0 Saint Paul W-3 P-8 319.0 1546 20.63 5.37 \n",
"42 3.0 Saint Paul W-3 P-9 438.0 2443 17.93 15.23 \n",
"\n",
" H_Dens_Vote% L_Dens_Vote% Pro_Weight Act_Weight Representation \n",
"29 5.97 20.58 7.19 8.08 0.89 \n",
"30 2.78 18.56 5.24 5.20 -0.04 \n",
"31 9.96 4.08 6.91 3.18 -3.73 \n",
"32 2.26 21.33 6.32 6.68 0.36 \n",
"33 19.67 21.92 6.56 7.88 1.32 \n",
"34 24.07 18.30 12.73 13.28 0.55 \n",
"35 5.78 22.88 8.73 10.57 1.84 \n",
"36 9.64 17.33 9.62 8.36 -1.26 \n",
"37 21.60 23.99 4.40 5.69 1.29 \n",
"38 12.71 14.99 6.88 5.28 -1.60 \n",
"39 7.00 17.17 7.58 6.86 -0.72 \n",
"40 8.42 24.06 3.38 3.60 0.22 \n",
"41 1.20 21.74 5.60 6.46 0.86 \n",
"42 9.68 19.41 8.85 8.87 0.02 "
]
},
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"P_15.query('Ward==3')"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
""
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"map_2015_SP_CityCouncilRepresentation_byPrecinct(3)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Ward 4 Precinct Analysis (Competitive) \n",
"\n",
""
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Ward | \n",
" Precinct | \n",
" Tot_Vote | \n",
" Tot_Reg | \n",
" Vote% | \n",
" H_Dens% | \n",
" H_Dens_Vote% | \n",
" L_Dens_Vote% | \n",
" Pro_Weight | \n",
" Act_Weight | \n",
" Representation | \n",
"
\n",
" \n",
" \n",
" \n",
" 43 | \n",
" 4.0 | \n",
" Saint Paul W-4 P-1 | \n",
" 417.0 | \n",
" 1582 | \n",
" 26.36 | \n",
" 17.64 | \n",
" 8.60 | \n",
" 30.16 | \n",
" 6.40 | \n",
" 8.50 | \n",
" 2.10 | \n",
"
\n",
" \n",
" 44 | \n",
" 4.0 | \n",
" Saint Paul W-4 P-10 | \n",
" 447.0 | \n",
" 1961 | \n",
" 22.79 | \n",
" 8.26 | \n",
" 7.41 | \n",
" 24.18 | \n",
" 7.93 | \n",
" 9.11 | \n",
" 1.18 | \n",
"
\n",
" \n",
" 45 | \n",
" 4.0 | \n",
" Saint Paul W-4 P-11 | \n",
" 492.0 | \n",
" 2128 | \n",
" 23.12 | \n",
" 15.74 | \n",
" 14.63 | \n",
" 24.71 | \n",
" 8.61 | \n",
" 10.03 | \n",
" 1.42 | \n",
"
\n",
" \n",
" 46 | \n",
" 4.0 | \n",
" Saint Paul W-4 P-12 | \n",
" 185.0 | \n",
" 1679 | \n",
" 11.02 | \n",
" 59.02 | \n",
" 4.74 | \n",
" 20.06 | \n",
" 6.79 | \n",
" 3.77 | \n",
" -3.02 | \n",
"
\n",
" \n",
" 47 | \n",
" 4.0 | \n",
" Saint Paul W-4 P-13 | \n",
" 258.0 | \n",
" 1336 | \n",
" 19.31 | \n",
" 17.44 | \n",
" 20.60 | \n",
" 19.04 | \n",
" 5.41 | \n",
" 5.26 | \n",
" -0.15 | \n",
"
\n",
" \n",
" 48 | \n",
" 4.0 | \n",
" Saint Paul W-4 P-14 | \n",
" 291.0 | \n",
" 1395 | \n",
" 20.86 | \n",
" 4.23 | \n",
" 0.00 | \n",
" 21.78 | \n",
" 5.64 | \n",
" 5.93 | \n",
" 0.29 | \n",
"
\n",
" \n",
" 49 | \n",
" 4.0 | \n",
" Saint Paul W-4 P-15 | \n",
" 292.0 | \n",
" 1500 | \n",
" 19.47 | \n",
" 8.13 | \n",
" 2.46 | \n",
" 20.97 | \n",
" 6.07 | \n",
" 5.95 | \n",
" -0.12 | \n",
"
\n",
" \n",
" 50 | \n",
" 4.0 | \n",
" Saint Paul W-4 P-2 | \n",
" 478.0 | \n",
" 1264 | \n",
" 37.82 | \n",
" 8.31 | \n",
" 40.00 | \n",
" 37.62 | \n",
" 5.11 | \n",
" 9.75 | \n",
" 4.64 | \n",
"
\n",
" \n",
" 51 | \n",
" 4.0 | \n",
" Saint Paul W-4 P-3 | \n",
" 182.0 | \n",
" 2281 | \n",
" 7.98 | \n",
" 73.70 | \n",
" 5.12 | \n",
" 16.00 | \n",
" 9.23 | \n",
" 3.71 | \n",
" -5.52 | \n",
"
\n",
" \n",
" 52 | \n",
" 4.0 | \n",
" Saint Paul W-4 P-4 | \n",
" 362.0 | \n",
" 1752 | \n",
" 20.66 | \n",
" 7.13 | \n",
" 7.20 | \n",
" 21.70 | \n",
" 7.09 | \n",
" 7.38 | \n",
" 0.29 | \n",
"
\n",
" \n",
" 53 | \n",
" 4.0 | \n",
" Saint Paul W-4 P-5 | \n",
" 278.0 | \n",
" 1253 | \n",
" 22.19 | \n",
" 9.10 | \n",
" 4.39 | \n",
" 23.97 | \n",
" 5.07 | \n",
" 5.67 | \n",
" 0.60 | \n",
"
\n",
" \n",
" 54 | \n",
" 4.0 | \n",
" Saint Paul W-4 P-6 | \n",
" 147.0 | \n",
" 1102 | \n",
" 13.34 | \n",
" 43.56 | \n",
" 2.50 | \n",
" 21.70 | \n",
" 4.46 | \n",
" 3.00 | \n",
" -1.46 | \n",
"
\n",
" \n",
" 55 | \n",
" 4.0 | \n",
" Saint Paul W-4 P-7 | \n",
" 405.0 | \n",
" 1714 | \n",
" 23.63 | \n",
" 15.34 | \n",
" 4.56 | \n",
" 27.08 | \n",
" 6.94 | \n",
" 8.26 | \n",
" 1.32 | \n",
"
\n",
" \n",
" 56 | \n",
" 4.0 | \n",
" Saint Paul W-4 P-8 | \n",
" 401.0 | \n",
" 2129 | \n",
" 18.84 | \n",
" 13.34 | \n",
" 4.23 | \n",
" 21.08 | \n",
" 8.61 | \n",
" 8.18 | \n",
" -0.43 | \n",
"
\n",
" \n",
" 57 | \n",
" 4.0 | \n",
" Saint Paul W-4 P-9 | \n",
" 270.0 | \n",
" 1639 | \n",
" 16.47 | \n",
" 33.44 | \n",
" 21.53 | \n",
" 13.93 | \n",
" 6.63 | \n",
" 5.50 | \n",
" -1.13 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Ward Precinct Tot_Vote Tot_Reg Vote% H_Dens% \\\n",
"43 4.0 Saint Paul W-4 P-1 417.0 1582 26.36 17.64 \n",
"44 4.0 Saint Paul W-4 P-10 447.0 1961 22.79 8.26 \n",
"45 4.0 Saint Paul W-4 P-11 492.0 2128 23.12 15.74 \n",
"46 4.0 Saint Paul W-4 P-12 185.0 1679 11.02 59.02 \n",
"47 4.0 Saint Paul W-4 P-13 258.0 1336 19.31 17.44 \n",
"48 4.0 Saint Paul W-4 P-14 291.0 1395 20.86 4.23 \n",
"49 4.0 Saint Paul W-4 P-15 292.0 1500 19.47 8.13 \n",
"50 4.0 Saint Paul W-4 P-2 478.0 1264 37.82 8.31 \n",
"51 4.0 Saint Paul W-4 P-3 182.0 2281 7.98 73.70 \n",
"52 4.0 Saint Paul W-4 P-4 362.0 1752 20.66 7.13 \n",
"53 4.0 Saint Paul W-4 P-5 278.0 1253 22.19 9.10 \n",
"54 4.0 Saint Paul W-4 P-6 147.0 1102 13.34 43.56 \n",
"55 4.0 Saint Paul W-4 P-7 405.0 1714 23.63 15.34 \n",
"56 4.0 Saint Paul W-4 P-8 401.0 2129 18.84 13.34 \n",
"57 4.0 Saint Paul W-4 P-9 270.0 1639 16.47 33.44 \n",
"\n",
" H_Dens_Vote% L_Dens_Vote% Pro_Weight Act_Weight Representation \n",
"43 8.60 30.16 6.40 8.50 2.10 \n",
"44 7.41 24.18 7.93 9.11 1.18 \n",
"45 14.63 24.71 8.61 10.03 1.42 \n",
"46 4.74 20.06 6.79 3.77 -3.02 \n",
"47 20.60 19.04 5.41 5.26 -0.15 \n",
"48 0.00 21.78 5.64 5.93 0.29 \n",
"49 2.46 20.97 6.07 5.95 -0.12 \n",
"50 40.00 37.62 5.11 9.75 4.64 \n",
"51 5.12 16.00 9.23 3.71 -5.52 \n",
"52 7.20 21.70 7.09 7.38 0.29 \n",
"53 4.39 23.97 5.07 5.67 0.60 \n",
"54 2.50 21.70 4.46 3.00 -1.46 \n",
"55 4.56 27.08 6.94 8.26 1.32 \n",
"56 4.23 21.08 8.61 8.18 -0.43 \n",
"57 21.53 13.93 6.63 5.50 -1.13 "
]
},
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"P_15.query('Ward==4')"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
""
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"map_2015_SP_CityCouncilRepresentation_byPrecinct(4)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Ward 5 Precinct Analysis (Competitive) \n",
"\n",
""
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Ward | \n",
" Precinct | \n",
" Tot_Vote | \n",
" Tot_Reg | \n",
" Vote% | \n",
" H_Dens% | \n",
" H_Dens_Vote% | \n",
" L_Dens_Vote% | \n",
" Pro_Weight | \n",
" Act_Weight | \n",
" Representation | \n",
"
\n",
" \n",
" \n",
" \n",
" 58 | \n",
" 5.0 | \n",
" Saint Paul W-5 P-1 | \n",
" 485.0 | \n",
" 1989 | \n",
" 24.38 | \n",
" 11.16 | \n",
" 8.56 | \n",
" 26.37 | \n",
" 10.43 | \n",
" 14.28 | \n",
" 3.85 | \n",
"
\n",
" \n",
" 59 | \n",
" 5.0 | \n",
" Saint Paul W-5 P-10 | \n",
" 47.0 | \n",
" 619 | \n",
" 7.59 | \n",
" 12.76 | \n",
" 20.25 | \n",
" 5.74 | \n",
" 3.25 | \n",
" 1.38 | \n",
" -1.87 | \n",
"
\n",
" \n",
" 60 | \n",
" 5.0 | \n",
" Saint Paul W-5 P-2 | \n",
" 916.0 | \n",
" 2411 | \n",
" 37.99 | \n",
" 7.18 | \n",
" 21.97 | \n",
" 39.23 | \n",
" 12.64 | \n",
" 26.97 | \n",
" 14.33 | \n",
"
\n",
" \n",
" 61 | \n",
" 5.0 | \n",
" Saint Paul W-5 P-3 | \n",
" 627.0 | \n",
" 2003 | \n",
" 31.30 | \n",
" 12.63 | \n",
" 13.44 | \n",
" 33.89 | \n",
" 10.50 | \n",
" 18.46 | \n",
" 7.96 | \n",
"
\n",
" \n",
" 62 | \n",
" 5.0 | \n",
" Saint Paul W-5 P-4 | \n",
" 466.0 | \n",
" 3426 | \n",
" 13.60 | \n",
" 28.20 | \n",
" 4.55 | \n",
" 17.15 | \n",
" 17.96 | \n",
" 13.72 | \n",
" -4.24 | \n",
"
\n",
" \n",
" 63 | \n",
" 5.0 | \n",
" Saint Paul W-5 P-5 | \n",
" 181.0 | \n",
" 1775 | \n",
" 10.20 | \n",
" 27.77 | \n",
" 11.16 | \n",
" 9.83 | \n",
" 9.31 | \n",
" 5.33 | \n",
" -3.98 | \n",
"
\n",
" \n",
" 64 | \n",
" 5.0 | \n",
" Saint Paul W-5 P-6 | \n",
" 195.0 | \n",
" 1783 | \n",
" 10.94 | \n",
" 4.82 | \n",
" 2.33 | \n",
" 11.37 | \n",
" 9.35 | \n",
" 5.74 | \n",
" -3.61 | \n",
"
\n",
" \n",
" 65 | \n",
" 5.0 | \n",
" Saint Paul W-5 P-7 | \n",
" 112.0 | \n",
" 1119 | \n",
" 10.01 | \n",
" 3.49 | \n",
" 17.95 | \n",
" 9.72 | \n",
" 5.87 | \n",
" 3.30 | \n",
" -2.57 | \n",
"
\n",
" \n",
" 66 | \n",
" 5.0 | \n",
" Saint Paul W-5 P-8 | \n",
" 219.0 | \n",
" 2297 | \n",
" 9.53 | \n",
" 20.55 | \n",
" 2.75 | \n",
" 11.29 | \n",
" 12.04 | \n",
" 6.45 | \n",
" -5.59 | \n",
"
\n",
" \n",
" 67 | \n",
" 5.0 | \n",
" Saint Paul W-5 P-9 | \n",
" 148.0 | \n",
" 1652 | \n",
" 8.96 | \n",
" 2.66 | \n",
" 4.55 | \n",
" 9.08 | \n",
" 8.66 | \n",
" 4.36 | \n",
" -4.30 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Ward Precinct Tot_Vote Tot_Reg Vote% H_Dens% \\\n",
"58 5.0 Saint Paul W-5 P-1 485.0 1989 24.38 11.16 \n",
"59 5.0 Saint Paul W-5 P-10 47.0 619 7.59 12.76 \n",
"60 5.0 Saint Paul W-5 P-2 916.0 2411 37.99 7.18 \n",
"61 5.0 Saint Paul W-5 P-3 627.0 2003 31.30 12.63 \n",
"62 5.0 Saint Paul W-5 P-4 466.0 3426 13.60 28.20 \n",
"63 5.0 Saint Paul W-5 P-5 181.0 1775 10.20 27.77 \n",
"64 5.0 Saint Paul W-5 P-6 195.0 1783 10.94 4.82 \n",
"65 5.0 Saint Paul W-5 P-7 112.0 1119 10.01 3.49 \n",
"66 5.0 Saint Paul W-5 P-8 219.0 2297 9.53 20.55 \n",
"67 5.0 Saint Paul W-5 P-9 148.0 1652 8.96 2.66 \n",
"\n",
" H_Dens_Vote% L_Dens_Vote% Pro_Weight Act_Weight Representation \n",
"58 8.56 26.37 10.43 14.28 3.85 \n",
"59 20.25 5.74 3.25 1.38 -1.87 \n",
"60 21.97 39.23 12.64 26.97 14.33 \n",
"61 13.44 33.89 10.50 18.46 7.96 \n",
"62 4.55 17.15 17.96 13.72 -4.24 \n",
"63 11.16 9.83 9.31 5.33 -3.98 \n",
"64 2.33 11.37 9.35 5.74 -3.61 \n",
"65 17.95 9.72 5.87 3.30 -2.57 \n",
"66 2.75 11.29 12.04 6.45 -5.59 \n",
"67 4.55 9.08 8.66 4.36 -4.30 "
]
},
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"P_15.query('Ward==5')"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
""
]
},
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"map_2015_SP_CityCouncilRepresentation_byPrecinct(5)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Ward 6 Precinct Analysis \n",
"\n",
""
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Ward | \n",
" Precinct | \n",
" Tot_Vote | \n",
" Tot_Reg | \n",
" Vote% | \n",
" H_Dens% | \n",
" H_Dens_Vote% | \n",
" L_Dens_Vote% | \n",
" Pro_Weight | \n",
" Act_Weight | \n",
" Representation | \n",
"
\n",
" \n",
" \n",
" \n",
" 68 | \n",
" 6.0 | \n",
" Saint Paul W-6 P-1 | \n",
" 165.0 | \n",
" 1370 | \n",
" 12.04 | \n",
" 4.23 | \n",
" 5.17 | \n",
" 12.35 | \n",
" 7.40 | \n",
" 8.54 | \n",
" 1.14 | \n",
"
\n",
" \n",
" 69 | \n",
" 6.0 | \n",
" Saint Paul W-6 P-10 | \n",
" 115.0 | \n",
" 977 | \n",
" 11.77 | \n",
" 13.92 | \n",
" 21.32 | \n",
" 10.23 | \n",
" 5.28 | \n",
" 5.96 | \n",
" 0.68 | \n",
"
\n",
" \n",
" 70 | \n",
" 6.0 | \n",
" Saint Paul W-6 P-11 | \n",
" 192.0 | \n",
" 1627 | \n",
" 11.80 | \n",
" 1.84 | \n",
" 13.33 | \n",
" 11.77 | \n",
" 8.79 | \n",
" 9.94 | \n",
" 1.15 | \n",
"
\n",
" \n",
" 71 | \n",
" 6.0 | \n",
" Saint Paul W-6 P-2 | \n",
" 244.0 | \n",
" 1236 | \n",
" 19.74 | \n",
" 4.85 | \n",
" 11.67 | \n",
" 20.15 | \n",
" 6.68 | \n",
" 12.64 | \n",
" 5.96 | \n",
"
\n",
" \n",
" 72 | \n",
" 6.0 | \n",
" Saint Paul W-6 P-3 | \n",
" 195.0 | \n",
" 1493 | \n",
" 13.06 | \n",
" 2.41 | \n",
" 2.78 | \n",
" 13.32 | \n",
" 8.07 | \n",
" 10.10 | \n",
" 2.03 | \n",
"
\n",
" \n",
" 73 | \n",
" 6.0 | \n",
" Saint Paul W-6 P-4 | \n",
" 169.0 | \n",
" 1867 | \n",
" 9.05 | \n",
" 15.43 | \n",
" 3.12 | \n",
" 10.13 | \n",
" 10.09 | \n",
" 8.75 | \n",
" -1.34 | \n",
"
\n",
" \n",
" 74 | \n",
" 6.0 | \n",
" Saint Paul W-6 P-5 | \n",
" 200.0 | \n",
" 2052 | \n",
" 9.75 | \n",
" 3.31 | \n",
" 0.00 | \n",
" 10.08 | \n",
" 11.09 | \n",
" 10.36 | \n",
" -0.73 | \n",
"
\n",
" \n",
" 75 | \n",
" 6.0 | \n",
" Saint Paul W-6 P-6 | \n",
" 186.0 | \n",
" 2391 | \n",
" 7.78 | \n",
" 4.56 | \n",
" 3.67 | \n",
" 7.98 | \n",
" 12.92 | \n",
" 9.63 | \n",
" -3.29 | \n",
"
\n",
" \n",
" 76 | \n",
" 6.0 | \n",
" Saint Paul W-6 P-7 | \n",
" 70.0 | \n",
" 623 | \n",
" 11.24 | \n",
" 26.16 | \n",
" 25.77 | \n",
" 6.09 | \n",
" 3.37 | \n",
" 3.63 | \n",
" 0.26 | \n",
"
\n",
" \n",
" 77 | \n",
" 6.0 | \n",
" Saint Paul W-6 P-8 | \n",
" 129.0 | \n",
" 1511 | \n",
" 8.54 | \n",
" 18.66 | \n",
" 14.89 | \n",
" 7.08 | \n",
" 8.16 | \n",
" 6.68 | \n",
" -1.48 | \n",
"
\n",
" \n",
" 78 | \n",
" 6.0 | \n",
" Saint Paul W-6 P-9 | \n",
" 163.0 | \n",
" 2239 | \n",
" 7.28 | \n",
" 10.14 | \n",
" 1.32 | \n",
" 7.95 | \n",
" 12.10 | \n",
" 8.44 | \n",
" -3.66 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Ward Precinct Tot_Vote Tot_Reg Vote% H_Dens% \\\n",
"68 6.0 Saint Paul W-6 P-1 165.0 1370 12.04 4.23 \n",
"69 6.0 Saint Paul W-6 P-10 115.0 977 11.77 13.92 \n",
"70 6.0 Saint Paul W-6 P-11 192.0 1627 11.80 1.84 \n",
"71 6.0 Saint Paul W-6 P-2 244.0 1236 19.74 4.85 \n",
"72 6.0 Saint Paul W-6 P-3 195.0 1493 13.06 2.41 \n",
"73 6.0 Saint Paul W-6 P-4 169.0 1867 9.05 15.43 \n",
"74 6.0 Saint Paul W-6 P-5 200.0 2052 9.75 3.31 \n",
"75 6.0 Saint Paul W-6 P-6 186.0 2391 7.78 4.56 \n",
"76 6.0 Saint Paul W-6 P-7 70.0 623 11.24 26.16 \n",
"77 6.0 Saint Paul W-6 P-8 129.0 1511 8.54 18.66 \n",
"78 6.0 Saint Paul W-6 P-9 163.0 2239 7.28 10.14 \n",
"\n",
" H_Dens_Vote% L_Dens_Vote% Pro_Weight Act_Weight Representation \n",
"68 5.17 12.35 7.40 8.54 1.14 \n",
"69 21.32 10.23 5.28 5.96 0.68 \n",
"70 13.33 11.77 8.79 9.94 1.15 \n",
"71 11.67 20.15 6.68 12.64 5.96 \n",
"72 2.78 13.32 8.07 10.10 2.03 \n",
"73 3.12 10.13 10.09 8.75 -1.34 \n",
"74 0.00 10.08 11.09 10.36 -0.73 \n",
"75 3.67 7.98 12.92 9.63 -3.29 \n",
"76 25.77 6.09 3.37 3.63 0.26 \n",
"77 14.89 7.08 8.16 6.68 -1.48 \n",
"78 1.32 7.95 12.10 8.44 -3.66 "
]
},
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"P_15.query('Ward==6')"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
""
]
},
"execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"map_2015_SP_CityCouncilRepresentation_byPrecinct(6)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Ward 7 Precinct Analysis \n",
"\n",
""
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Ward | \n",
" Precinct | \n",
" Tot_Vote | \n",
" Tot_Reg | \n",
" Vote% | \n",
" H_Dens% | \n",
" H_Dens_Vote% | \n",
" L_Dens_Vote% | \n",
" Pro_Weight | \n",
" Act_Weight | \n",
" Representation | \n",
"
\n",
" \n",
" \n",
" \n",
" 79 | \n",
" 7.0 | \n",
" Saint Paul W-7 P-1 | \n",
" 191.0 | \n",
" 2050 | \n",
" 9.32 | \n",
" 11.07 | \n",
" 6.17 | \n",
" 9.71 | \n",
" 10.41 | \n",
" 10.73 | \n",
" 0.32 | \n",
"
\n",
" \n",
" 80 | \n",
" 7.0 | \n",
" Saint Paul W-7 P-10 | \n",
" 106.0 | \n",
" 1376 | \n",
" 7.70 | \n",
" 2.33 | \n",
" 18.75 | \n",
" 7.44 | \n",
" 6.99 | \n",
" 5.96 | \n",
" -1.03 | \n",
"
\n",
" \n",
" 81 | \n",
" 7.0 | \n",
" Saint Paul W-7 P-11 | \n",
" 63.0 | \n",
" 1205 | \n",
" 5.23 | \n",
" 61.91 | \n",
" 3.75 | \n",
" 7.63 | \n",
" 6.12 | \n",
" 3.54 | \n",
" -2.58 | \n",
"
\n",
" \n",
" 82 | \n",
" 7.0 | \n",
" Saint Paul W-7 P-12 | \n",
" 266.0 | \n",
" 2565 | \n",
" 10.37 | \n",
" 32.51 | \n",
" 5.76 | \n",
" 12.59 | \n",
" 13.02 | \n",
" 14.94 | \n",
" 1.92 | \n",
"
\n",
" \n",
" 83 | \n",
" 7.0 | \n",
" Saint Paul W-7 P-13 | \n",
" 244.0 | \n",
" 1862 | \n",
" 13.10 | \n",
" 21.43 | \n",
" 11.03 | \n",
" 13.67 | \n",
" 9.46 | \n",
" 13.71 | \n",
" 4.25 | \n",
"
\n",
" \n",
" 84 | \n",
" 7.0 | \n",
" Saint Paul W-7 P-2 | \n",
" 71.0 | \n",
" 1247 | \n",
" 5.69 | \n",
" 1.68 | \n",
" 4.76 | \n",
" 5.71 | \n",
" 6.33 | \n",
" 3.99 | \n",
" -2.34 | \n",
"
\n",
" \n",
" 85 | \n",
" 7.0 | \n",
" Saint Paul W-7 P-3 | \n",
" 96.0 | \n",
" 1420 | \n",
" 6.76 | \n",
" 1.27 | \n",
" 0.00 | \n",
" 6.85 | \n",
" 7.21 | \n",
" 5.39 | \n",
" -1.82 | \n",
"
\n",
" \n",
" 86 | \n",
" 7.0 | \n",
" Saint Paul W-7 P-4 | \n",
" 75.0 | \n",
" 894 | \n",
" 8.39 | \n",
" 12.98 | \n",
" 12.93 | \n",
" 7.71 | \n",
" 4.54 | \n",
" 4.21 | \n",
" -0.33 | \n",
"
\n",
" \n",
" 87 | \n",
" 7.0 | \n",
" Saint Paul W-7 P-5 | \n",
" 253.0 | \n",
" 1348 | \n",
" 18.77 | \n",
" 19.88 | \n",
" 21.64 | \n",
" 18.06 | \n",
" 6.85 | \n",
" 14.21 | \n",
" 7.36 | \n",
"
\n",
" \n",
" 88 | \n",
" 7.0 | \n",
" Saint Paul W-7 P-7 | \n",
" 93.0 | \n",
" 1190 | \n",
" 7.82 | \n",
" 22.69 | \n",
" 11.85 | \n",
" 6.63 | \n",
" 6.04 | \n",
" 5.22 | \n",
" -0.82 | \n",
"
\n",
" \n",
" 89 | \n",
" 7.0 | \n",
" Saint Paul W-7 P-8 | \n",
" 137.0 | \n",
" 1672 | \n",
" 8.19 | \n",
" 12.68 | \n",
" 1.42 | \n",
" 9.18 | \n",
" 8.49 | \n",
" 7.70 | \n",
" -0.79 | \n",
"
\n",
" \n",
" 90 | \n",
" 7.0 | \n",
" Saint Paul W-7 P-9 | \n",
" 103.0 | \n",
" 1508 | \n",
" 6.83 | \n",
" 5.90 | \n",
" 0.00 | \n",
" 7.26 | \n",
" 7.66 | \n",
" 5.79 | \n",
" -1.87 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Ward Precinct Tot_Vote Tot_Reg Vote% H_Dens% \\\n",
"79 7.0 Saint Paul W-7 P-1 191.0 2050 9.32 11.07 \n",
"80 7.0 Saint Paul W-7 P-10 106.0 1376 7.70 2.33 \n",
"81 7.0 Saint Paul W-7 P-11 63.0 1205 5.23 61.91 \n",
"82 7.0 Saint Paul W-7 P-12 266.0 2565 10.37 32.51 \n",
"83 7.0 Saint Paul W-7 P-13 244.0 1862 13.10 21.43 \n",
"84 7.0 Saint Paul W-7 P-2 71.0 1247 5.69 1.68 \n",
"85 7.0 Saint Paul W-7 P-3 96.0 1420 6.76 1.27 \n",
"86 7.0 Saint Paul W-7 P-4 75.0 894 8.39 12.98 \n",
"87 7.0 Saint Paul W-7 P-5 253.0 1348 18.77 19.88 \n",
"88 7.0 Saint Paul W-7 P-7 93.0 1190 7.82 22.69 \n",
"89 7.0 Saint Paul W-7 P-8 137.0 1672 8.19 12.68 \n",
"90 7.0 Saint Paul W-7 P-9 103.0 1508 6.83 5.90 \n",
"\n",
" H_Dens_Vote% L_Dens_Vote% Pro_Weight Act_Weight Representation \n",
"79 6.17 9.71 10.41 10.73 0.32 \n",
"80 18.75 7.44 6.99 5.96 -1.03 \n",
"81 3.75 7.63 6.12 3.54 -2.58 \n",
"82 5.76 12.59 13.02 14.94 1.92 \n",
"83 11.03 13.67 9.46 13.71 4.25 \n",
"84 4.76 5.71 6.33 3.99 -2.34 \n",
"85 0.00 6.85 7.21 5.39 -1.82 \n",
"86 12.93 7.71 4.54 4.21 -0.33 \n",
"87 21.64 18.06 6.85 14.21 7.36 \n",
"88 11.85 6.63 6.04 5.22 -0.82 \n",
"89 1.42 9.18 8.49 7.70 -0.79 \n",
"90 0.00 7.26 7.66 5.79 -1.87 "
]
},
"execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"P_15.query('Ward==7')"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
""
]
},
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"map_2015_SP_CityCouncilRepresentation_byPrecinct(7)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Next Steps \n",
"\n",
"Hopefully, you have enjoyed reading this report and you are ready to take action. Here are some ways that you can make a difference and make this vision into a reality not in Saint Paul, but in your city/town:\n",
"\n",
"**Steps for everyone anywhere in the country (this is the point of the Open Data Project)**\n",
"\n",
"1) If your city has upcoming elections and filing date is still open. Run for political office now!\n",
"\n",
"2) Share this report to other data experts and python programmer. Replicate the aforementioned analysis in your city/town. Use this information to hold your local officials accountable. [I can also do the analysis for discounted price]\n",
"\n",
"3) Create a list of local community leaders/ experts in the different category groups. These people have already have built years of trust, and you seek to activate them in an intentional manner.\n",
"\n",
"4) Be creative and engaging!\n",
"\n",
"\n",
"\n",
"**Steps for people in Saint Paul**\n",
"\n",
"1) If your neighborhood/ community is under-represented, run for city council. The filing date ends at August 13th! You can get more information [here](https://www.ramseycounty.us/residents/elections-voting/candidates/candidate-filing)\n",
"\n",
"2) If you are running for office, take the pledge of the Citizen-First Campaign, and let's support each other in getting citizens engaged. Let us work together in creating a more equitable Saint Paul\n",
"\n",
"3) Please support my campaign! I'm currently looking for volunteers, community leaders, and core campaign members\n",
"\n",
"* You can follow me in my [candidate Facebook page](https://www.facebook.com/AbuForWard1/), I will be setting up a donation page soon\n",
"* If you are in Ward 1, please join my [Ward 1 community page](https://www.facebook.com/groups/2359329174387001/)\n",
"\n",
"4) Share my report to your network and friends EVEN if not in Saint Paul. Discuss the topics presented. The time for organizing is now.\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Run Code (Prior to running report) "
]
},
{
"cell_type": "code",
"execution_count": 22,
"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",
"\n",
"#load Data\n",
"P_15= pd.read_csv('Data/SaintPaul_PrecinctAnalysis_06-24-19.csv')\n",
"P_15.columns= ['Ward', 'Precinct', 'Tot_Vote', 'Tot_Reg','Vote%', 'Total_WardVotes', 'Total_WardRegistered','Pro_Weight', 'Act_Weight', 'Representation', 'HDensity_Register', 'H_Vote17', 'H_Dens_Vote%', 'L_Registered','L_Vote17', 'L_Dens_Vote%', 'H_Dens%']\n",
"Features= ['Ward','Precinct', 'Tot_Vote', 'Tot_Reg','Vote%','H_Dens%', 'H_Dens_Vote%', 'L_Dens_Vote%','Pro_Weight', 'Act_Weight', 'Representation']\n",
"P_15= P_15[Features]\n",
"\n",
"\n",
"\n",
"\n",
"def map_2015_SP_CityCouncilRepresentation_byPrecinct(Ward=0):\n",
" #setup\n",
" sp_geo = r'Shapefiles/SaintPaul_VotingPrecincts.json'\n",
" \n",
" if Ward==0:\n",
" B=P_15 \n",
" A='City Council'\n",
" zo= 12\n",
" else: \n",
" B= P_15[(P_15['WardCode'] == 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=['PrecinctName','Representation'],\n",
" key_on=\"feature.properties.Precinct\",\n",
" fill_color='YlOrRd', \n",
" fill_opacity=0.7, \n",
" line_opacity=0.2,\n",
" legend_name='2015 Saint Paul ' + A +' Precinct Representation: 06/24/19',\n",
" highlight= True\n",
" )\n",
" folium.LayerControl().add_to(SP_map)\n",
" \n",
" # display map\n",
" return SP_map\n"
]
},
{
"cell_type": "code",
"execution_count": 101,
"metadata": {},
"outputs": [],
"source": [
"#map_2015_SP_CityCouncilRepresentation_byPrecinct()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[Click to go to Table of Contents](#content)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Index(['WardCode', 'PrecinctName', 'Precinct_Vote', 'Precinct_Register',\n",
" 'Voting%', 'Total_WardVotes', 'Total_WardRegistered',\n",
" 'Projected_Weight', 'Actual_Weight', 'Representation', 'H_Registered',\n",
" 'H_Vote15', 'H_Density_Vote%', 'L_Registered', 'L_Vote15',\n",
" 'L_Density_Vote%', 'H_Density%'],\n",
" dtype='object')"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"P_15= pd.read_csv('Data/SaintPaul_PrecinctAnalysis_06-24-19.csv')\n",
"P_15.columns"
]
},
{
"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
}