2022-03-29 17:09:40 +02:00
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Data gemeenteraadsverkiezingen 2022 Nederland\n",
"\n",
2022-03-30 15:43:08 +02:00
"Dit notebook is voor het verwerken van de data van de gemeenteraadsverkiezingen van 2022. Er zal hier stap voor stap door de data gelopen worden om het proces reproduceerbaar te maken voor latere verkiezingen. De eerste stap was de data ophalen van de bronnen, zowel de overheid als waar is mijn stemlokaal (voor geografische data van de stemlokalen). De bronnen gebruikt voor de data zijn voor de verkiezingen van 2022 is als volgt:\n",
2022-03-29 17:09:40 +02:00
"\n",
2022-04-12 16:39:06 +02:00
"- [Verkiezingsuitslagen Gemeenteraad 2022](https://data.overheid.nl/dataset/08b04bec-3332-4c76-bb0c-68bfaeb5df43)\n",
" - [Directe link naar uitslagen per gemeente CSV](https://data.overheid.nl/sites/default/files/dataset/08b04bec-3332-4c76-bb0c-68bfaeb5df43/resources/GR2022_2022-03-29T15.14.zip)\n",
2022-03-30 15:43:08 +02:00
" - [Directe link naar kandidatenlijst met uitslagen CSV](https://data.overheid.nl/sites/default/files/dataset/08b04bec-3332-4c76-bb0c-68bfaeb5df43/resources/GR2022_alle-kandidaten_2022-02-22T08.34.csv)\n",
2022-03-29 17:09:40 +02:00
"- [Waar is mijn stemlokaal stembureau data](https://waarismijnstemlokaal.nl/data)\n",
2022-03-30 15:43:08 +02:00
" - [Directe link naar waar is mijn stemlokaal gemeenteraad 2022 CSV (CKAN)](https://ckan.dataplatform.nl/datastore/dump/d6a1b4c4-73c8-457b-9b75-a38428bded68)\n",
" - [Verkiezingsuitslagen gemeenteraadsverkiezingen 2022 geodata (Volkskrant)](https://data.openstate.eu/dataset/verkiezingsuitslagen-gemeenteraadsverkiezingen-2022)\n",
" - [Directe link naar GEOJSON bestand](https://data.openstate.eu/dataset/a1767f1b-bf0c-409b-b3b1-3af9954b57f4/resource/413be255-5070-48f4-b631-895097976abb/download/2022gr.geo.json)\n",
"- [CBS Wijk- en buurtkaart 2021](https://www.cbs.nl/nl-nl/dossier/nederland-regionaal/geografische-data/wijk-en-buurtkaart-2021)\n",
" - [Directe link naar zip bestand met SHP bestand er in](https://www.cbs.nl/-/media/cbs/dossiers/nederland-regionaal/wijk-en-buurtstatistieken/wijkbuurtkaart_2021_v1.zip)\n",
2022-04-12 16:39:06 +02:00
"- [CBS bevolkingsdichtheid kaart 100 bij 100 meter](https://www.cbs.nl/nl-nl/dossier/nederland-regionaal/geografische-data/kaart-van-100-meter-bij-100-meter-met-statistieken)\n",
2022-04-04 15:09:40 +02:00
" - [Directe link naar 7z bestand met SHP bestand er in](https://www.cbs.nl/-/media/cbs/dossiers/nederland-regionaal/vierkanten/100/nl_vierkant_100meter_bij_100meter.7z)\n",
2022-04-12 16:39:06 +02:00
"- [CBS bevolkingsdichtheid kaart 500 bij 500 meter](https://www.cbs.nl/nl-nl/dossier/nederland-regionaal/geografische-data/kaart-van-500-meter-bij-500-meter-met-statistieken)\n",
" - [Directe link naar 7z bestand met SHP bestand er in](https://www.cbs.nl/-/media/cbs/dossiers/nederland-regionaal/vierkanten/500/2021-cbs_vk500_2020_v1.zip)\n",
2022-03-29 17:09:52 +02:00
"\n",
2022-04-20 13:03:38 +02:00
"De eerste stap die we moeten maken is de data importeren voor de analyse, daarna kunnen we kijken hoe goed de data is, hoe we het aan kunnen vullen, en wat er mee te doen. De makkelijkste structuur die we vonden was het geojson bestand van open state en de Volkskrant, daar staan alle stemlokalen al in een lijst, en we hebben een makkelijk framework om het te importeren; geopandas. We laden deze dan ook als eerste in."
2022-03-29 17:09:52 +02:00
]
},
{
"cell_type": "code",
2022-04-14 15:43:51 +02:00
"execution_count": 1,
2022-03-30 15:43:08 +02:00
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/lillian/.local/lib/python3.9/site-packages/fiona/collection.py:208: FeatureWarning: Empty field name at index 61\n",
" self._schema = self.session.get_schema()\n",
"/home/lillian/anaconda3/lib/python3.9/site-packages/geopandas/geodataframe.py:600: UserWarning: Empty field name at index 61\n",
" for feature in features_lst:\n"
]
}
],
"source": [
"import pandas as pd\n",
"import geopandas as gpd\n",
"\n",
"crs = {'init':'EPSG:4326'}\n",
2022-04-04 15:09:40 +02:00
"df_geojson = gpd.read_file(r'../data/2022gr.geo.json', crs=crs)"
2022-03-30 15:43:08 +02:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We importeren nu de gemeente shapefile kaart van het CBS, om de overlay van onze stemlokalen eroverheen te kunnen doen. "
]
},
{
"cell_type": "code",
2022-04-14 15:43:51 +02:00
"execution_count": 2,
2022-03-30 15:43:08 +02:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<AxesSubplot:>"
]
},
2022-04-14 15:43:51 +02:00
"execution_count": 2,
2022-03-30 15:43:08 +02:00
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
2022-04-14 15:43:51 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAOQAAAD4CAYAAAD8Q0ptAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAB9nUlEQVR4nO29d5hk6V3f+3nPOXUqx845TM65Z1eriBAIAcKA4QpzsSUbC/yQrn0v2BgHHPDFxnCJtpEJNkmAAZkggYSEtCvtandyjj3TOXdXzqfOOfePU3Wmqququ2dnZqdnpz7Po0fT1V3Vp3rrd973/YXvV5imSYsWLbYH0tO+gBYtWjygFZAtWmwjWgHZosU2ohWQLVpsI1oB2aLFNkJ52hfQiPb2dnN4ePhpX0aLFk+M8+fPr5qm2bH+8W0ZkMPDw5w7d+5pX0aLFk8MIcRUo8dbW9YWLbYRrYBs0WIb0QrIFi22Ea2AbNFiG9EKyBYtthGtgGzRYhvRCsgWLbYRrYBs0WIb0QrIFm8LDMOkWDIwjMbzvYZh8itfHOfqbOItvrKHY1t26rRo8TC8Nr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VVgci1b872paA6/29H0uQd6AnZD+Ewsi2FiZ3vX1/oaFf+d5S1ko6byuXLSaCVVwCEJewQLoKibnJ2McXIwVN6qm0ysZQm5HWTKrX19ITdz8Rx9ITemaTKfyGOasJIusJIu4JAFxwZCqIqECcQyRbqCDjv4J1cfrv7ZiFZAvo1YSRX4sT+6QrqgMbma4Uh/iFRO48xElJ2dPoq6gf4YEhMdfifnJmMNz2GH+gJcnUsS8ars6PBybc5aOQ/1B7kxn0Q
2022-03-30 15:43:08 +02:00
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
2022-04-14 15:43:51 +02:00
"metadata": {
"needs_background": "light"
},
2022-03-30 15:43:08 +02:00
"output_type": "display_data"
}
],
"source": [
"nl_map = gpd.read_file(r'../data/shape/Netherlands_shapefile/gemeente_2021_v1.shp')\n",
"nl_map.to_crs(epsg=4326).plot()\n"
]
},
{
"cell_type": "code",
2022-04-14 15:43:51 +02:00
"execution_count": 3,
2022-04-12 16:39:06 +02:00
"metadata": {},
"outputs": [
{
2022-04-13 15:08:29 +02:00
"name": "stdout",
"output_type": "stream",
"text": [
" GM_CODE GM_NAAM H2O OAD STED BEV_DICHTH AANT_INW \\\n",
"0 GM0034 Almere JA -99999999 -99999999 -99999999 -99999999 \n",
"1 GM0050 Zeewolde JA -99999999 -99999999 -99999999 -99999999 \n",
"2 GM0060 Ameland JA -99999999 -99999999 -99999999 -99999999 \n",
"3 GM0072 Harlingen JA -99999999 -99999999 -99999999 -99999999 \n",
"4 GM0088 Schiermonnikoog JA -99999999 -99999999 -99999999 -99999999 \n",
".. ... ... ... ... ... ... ... \n",
"430 GM1966 Het Hogeland NEE 414 5 99 47834 \n",
"431 GM1969 Westerkwartier NEE 476 5 176 63678 \n",
"432 GM1970 Noardeast-Fryslân NEE 463 5 120 45481 \n",
"433 GM1978 Molenlanden NEE 393 5 243 44130 \n",
"434 GM1979 Eemsdelta NEE 692 4 170 45587 \n",
"\n",
" AANT_MAN AANT_VROUW P_00_14_JR ... P_TURKIJE P_OVER_NW OPP_TOT \\\n",
"0 -99999999 -99999999 -99999999 ... -99999999 -99999999 -99999999 \n",
"1 -99999999 -99999999 -99999999 ... -99999999 -99999999 -99999999 \n",
"2 -99999999 -99999999 -99999999 ... -99999999 -99999999 -99999999 \n",
"3 -99999999 -99999999 -99999999 ... -99999999 -99999999 -99999999 \n",
"4 -99999999 -99999999 -99999999 ... -99999999 -99999999 -99999999 \n",
".. ... ... ... ... ... ... ... \n",
"430 24052 23782 15 ... 0 3 90308 \n",
"431 32034 31644 17 ... 0 3 36887 \n",
"432 22879 22602 17 ... 0 2 51645 \n",
"433 22317 21813 18 ... 0 2 19158 \n",
"434 22841 22746 14 ... 2 5 36407 \n",
"\n",
" OPP_LAND OPP_WATER JRSTATCODE JAAR Shape_Leng Shape_Area \\\n",
"0 -99999999 -99999999 2021GM0034 2021 122665.358635 1.095623e+08 \n",
"1 -99999999 -99999999 2021GM0050 2021 83290.773617 1.633050e+07 \n",
"2 -99999999 -99999999 2021GM0060 2021 156406.894023 2.085914e+08 \n",
"3 -99999999 -99999999 2021GM0072 2021 104274.683035 3.618323e+08 \n",
"4 -99999999 -99999999 2021GM0088 2021 152568.858991 1.624101e+08 \n",
".. ... ... ... ... ... ... \n",
"430 48249 42059 2021GM1966 2021 321301.166576 4.875998e+08 \n",
"431 36269 618 2021GM1969 2021 99030.762281 3.688457e+08 \n",
"432 37783 13862 2021GM1970 2021 238426.959926 3.837930e+08 \n",
"433 18173 986 2021GM1978 2021 88570.376691 1.915841e+08 \n",
"434 26789 9618 2021GM1979 2021 173966.493452 2.727771e+08 \n",
"\n",
" geometry \n",
"0 MULTIPOLYGON (((150213.998 479503.726, 150087.... \n",
"1 MULTIPOLYGON (((170588.413 486792.192, 170570.... \n",
"2 POLYGON ((196000.000 610000.000, 196000.000 60... \n",
"3 MULTIPOLYGON (((158392.775 580357.500, 158387.... \n",
"4 POLYGON ((219000.000 616567.418, 219000.000 61... \n",
".. ... \n",
"430 MULTIPOLYGON (((217037.735 601967.991, 217043.... \n",
"431 POLYGON ((215186.661 595044.495, 215190.788 59... \n",
"432 MULTIPOLYGON (((207769.575 603284.528, 207773.... \n",
"433 POLYGON ((123569.533 440132.167, 123576.153 44... \n",
"434 MULTIPOLYGON (((269190.000 594253.046, 269190.... \n",
"\n",
"[435 rows x 38 columns]\n"
]
2022-04-12 16:39:06 +02:00
}
],
"source": [
2022-04-13 15:08:29 +02:00
"print(nl_map)"
2022-04-12 16:39:06 +02:00
]
},
{
"cell_type": "code",
2022-04-14 15:43:51 +02:00
"execution_count": 4,
2022-03-29 17:09:52 +02:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
2022-03-30 15:43:08 +02:00
"<AxesSubplot:>"
2022-03-29 17:09:52 +02:00
]
},
2022-04-14 15:43:51 +02:00
"execution_count": 4,
2022-03-29 17:09:52 +02:00
"metadata": {},
"output_type": "execute_result"
2022-03-30 15:43:08 +02:00
},
{
"data": {
2022-04-14 15:43:51 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAGMAAAI/CAYAAABj6GcwAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAANdklEQVR4nO3cb2xd913H8fenTsu60nWJaluhXXE1RWiI/alklaI8gYVMEUEkmlRpE0N+UC1PmLRqSMwwJDSJCfNk4glPAkxYasdaaeSP1qnMMlQTqCt1SGhaWvA2vNAkit2WUlindm2/PPCJ8BI799rX9/oTn89Lqs7/nJ/y7jnnHic3qirCww1bPYD4f4lhJDGMJIaRxDCSGEZ2DPJkt99+e42NjQ3ylHZOnTr1UlUNr7ZtoDHGxsaYm5sb5CntSPrBWttymzKSGEYSw0hiGEkMI4lhJDGMJIaRxDCSGEYSw0hiGEkMI4lhJDGMJIaRxDCSGEYSw0hiGEkMIwP92yHXs+Onz/O5R87wzhXrd777Rl59/cf8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cRKYaOYngBObM5x26+aj7V8DTwI/J+lFSQ8AU8B+SfPA/mY5erSj0w5V9ck1Nu3b5LG0Xt7AjSSGkcQwkhhGEsNIYhhJDCOJYSQxjCSGkcQwkhhGEsNIYhhJDCOJYSQxjCSGkcQwkhhGEsNIYhhJDCOJYSQxjCSGkcQwkhhGEsNIYhhJDCOJYSQxjCSGkcQwkhhGEsNIYhhJDCOJYSQxjCSGkcQwkhhGEsNIYhhJDCOJYSQxjCSGkcQwkhhGEsNIYhhJDCOJYSQxjCSGkcQwkhhGEsNIYhhJDCOJYSQxjCSGkcQwkhhGEsNIYhhJDCOJYSQxjCSGkcQwkhhGEsNIYhhJDCOJYSQxjCSGkcQw0lM
2022-03-30 15:43:08 +02:00
"text/plain": [
"<Figure size 720x720 with 1 Axes>"
]
},
2022-04-14 15:43:51 +02:00
"metadata": {
"needs_background": "light"
},
2022-03-30 15:43:08 +02:00
"output_type": "display_data"
}
],
"source": [
"import matplotlib.pyplot as plt\n",
"\n",
"fig, ax = plt.subplots(figsize = (10,10))\n",
"nl_map.to_crs(epsg=4326).plot(ax=ax, color='lightgrey')\n",
"df_geojson.plot(ax=ax)"
]
},
2022-04-04 15:09:40 +02:00
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We hebben hier een probleem dat sommige punten de coördinaten 0,0 hebben, dit is niet iets wat we willen weergeven. Laten we eerst kijken waarom dit het geval is in de data voordat we het er helemaal uithalen."
]
},
2022-03-30 15:43:08 +02:00
{
"cell_type": "code",
2022-04-14 15:43:51 +02:00
"execution_count": 5,
2022-03-30 15:43:08 +02:00
"metadata": {},
"outputs": [
{
2022-04-04 15:09:40 +02:00
"name": "stdout",
"output_type": "stream",
"text": [
"Stembureau 32\n",
"Adres \n",
"Locatie SB32\n",
"description Stembureau Mobiel Stembureau 1\n",
"Geldige stemmen 99\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 2520, Length: 973, dtype: object\n",
"Stembureau 33\n",
"Adres \n",
"Locatie SB33\n",
"description Stembureau Mobiel Stembureau 2\n",
"Geldige stemmen 115\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 2521, Length: 973, dtype: object\n",
"Stembureau 157\n",
"Adres \n",
"Locatie SB157\n",
"description Stembureau Stembureau Stembus\n",
"Geldige stemmen 72\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 2918, Length: 973, dtype: object\n",
"Stembureau 171\n",
"Adres \n",
"Locatie SB171\n",
"description Stembureau Stembureau Stembureau op locatie al...\n",
"Geldige stemmen 174\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 3579, Length: 973, dtype: object\n",
"Stembureau 172\n",
"Adres \n",
"Locatie SB172\n",
"description Stembureau Stembureau Stembureau op locatie al...\n",
"Geldige stemmen 66\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 3580, Length: 973, dtype: object\n",
"Stembureau 173\n",
"Adres \n",
"Locatie SB173\n",
"description Stembureau Stembureau Stembureau op locatie al...\n",
"Geldige stemmen 162\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 3581, Length: 973, dtype: object\n",
"Stembureau 174\n",
"Adres \n",
"Locatie SB174\n",
"description Stembureau Stembureau Stembureau op locatie al...\n",
"Geldige stemmen 65\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 3582, Length: 973, dtype: object\n",
"Stembureau 175\n",
"Adres \n",
"Locatie SB175\n",
"description Stembureau Stembureau Stembureau op locatie al...\n",
"Geldige stemmen 121\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 3583, Length: 973, dtype: object\n",
"Stembureau 39\n",
"Adres \n",
"Locatie SB39\n",
"description Stembureau Mobiel stembureau met beperkte toeg...\n",
"Geldige stemmen 56\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 5494, Length: 973, dtype: object\n",
"Stembureau 34\n",
"Adres \n",
"Locatie SB34\n",
"description Stembureau Stembureau Mobiel stembureau verzor...\n",
"Geldige stemmen 119\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 5784, Length: 973, dtype: object\n",
"Stembureau 35\n",
"Adres \n",
"Locatie SB35\n",
"description Stembureau Stembureau Mobiel stembureau verzor...\n",
"Geldige stemmen 151\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 5785, Length: 973, dtype: object\n",
"Stembureau 11\n",
"Adres \n",
"Locatie SB11\n",
"description Stembureau Mobiel stembureau Ommedijk\n",
"Geldige stemmen 14\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 6260, Length: 973, dtype: object\n",
"Stembureau 12\n",
"Adres \n",
"Locatie SB12\n",
"description Stembureau Mobiel stembureau Van Alphenstaete ...\n",
"Geldige stemmen 68\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 6261, Length: 973, dtype: object\n",
"Stembureau 70\n",
"Adres \n",
"Locatie SB70\n",
"description Stembureau Mobiel stembureau\n",
"Geldige stemmen 34\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 6738, Length: 973, dtype: object\n",
"Stembureau 71\n",
"Adres \n",
"Locatie SB71\n",
"description Stembureau Mobiel stembureau\n",
"Geldige stemmen 43\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 6739, Length: 973, dtype: object\n",
"Stembureau 699\n",
"Adres \n",
"Locatie SB699\n",
"description Stembureau Stembureau Mobiel stembureau\n",
"Geldige stemmen 59\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 6863, Length: 973, dtype: object\n",
"Stembureau 32\n",
"Adres \n",
"Locatie SB32\n",
"description Stembureau Mobielstembureau\n",
"Geldige stemmen 63\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 7348, Length: 973, dtype: object\n",
"Stembureau 90\n",
"Adres \n",
"Locatie SB90\n",
"description Stembureau Roll and Vote\n",
"Geldige stemmen 339\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 7364, Length: 973, dtype: object\n",
"Stembureau 19\n",
"Adres \n",
"Locatie SB19\n",
"description Stembureau Mobiel stembureau\n",
"Geldige stemmen 77\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 7857, Length: 973, dtype: object\n",
"Stembureau 1428\n",
"Adres \n",
"Locatie SB1428\n",
"description Stembureau Drive-thru parkeerplaats Rusheuvel 1\n",
"Geldige stemmen 163\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 7912, Length: 973, dtype: object\n",
"Stembureau 1437\n",
"Adres \n",
"Locatie SB1437\n",
"description Stembureau Drive-thru parkeerplaats Rusheuvel 2\n",
"Geldige stemmen 239\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 7913, Length: 973, dtype: object\n",
"Stembureau 1528\n",
"Adres \n",
"Locatie SB1528\n",
"description Stembureau Drive-thru parkeerplaats Rusheuvel 1\n",
"Geldige stemmen 323\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 7923, Length: 973, dtype: object\n",
"Stembureau 1537\n",
"Adres \n",
"Locatie SB1537\n",
"description Stembureau Drive-thru parkeerplaats Rusheuvel 2\n",
"Geldige stemmen 208\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 7924, Length: 973, dtype: object\n",
"Stembureau 1541\n",
"Adres \n",
"Locatie SB1541\n",
"description Stembureau Mobiel stembureau\n",
"Geldige stemmen 125\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 7926, Length: 973, dtype: object\n",
"Stembureau 200\n",
"Adres \n",
"Locatie SB200\n",
"description Stembureau Mobiel stembureau Ma\n",
"Geldige stemmen 30\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 7958, Length: 973, dtype: object\n",
"Stembureau 201\n",
"Adres \n",
"Locatie SB201\n",
"description Stembureau Mobiel stembureau Di\n",
"Geldige stemmen 30\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 7959, Length: 973, dtype: object\n",
"Stembureau 202\n",
"Adres \n",
"Locatie SB202\n",
"description Stembureau Mobiel stembureau Woe\n",
"Geldige stemmen 44\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 7960, Length: 973, dtype: object\n",
"Stembureau 30\n",
"Adres \n",
"Locatie SB30\n",
"description Stembureau Stembureau voor de telling stembure...\n",
"Geldige stemmen 2004\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 8108, Length: 973, dtype: object\n",
"Stembureau 40\n",
"Adres \n",
"Locatie SB40\n",
"description Stembureau Stembureau voor de telling stembure...\n",
"Geldige stemmen 2953\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 8109, Length: 973, dtype: object\n",
"Stembureau 990\n",
"Adres \n",
"Locatie SB990\n",
"description Stembureau Mobiel stembureau (meerdere plaatsen)\n",
"Geldige stemmen 47\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 8161, Length: 973, dtype: object\n",
"Stembureau 991\n",
"Adres \n",
"Locatie SB991\n",
"description Stembureau Mobiel stembureau (meerdere plaatsen)\n",
"Geldige stemmen 70\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 8162, Length: 973, dtype: object\n",
"Stembureau 992\n",
"Adres \n",
"Locatie SB992\n",
"description Stembureau Mobiel stembureau (meerdere plaatsen)\n",
"Geldige stemmen 39\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 8163, Length: 973, dtype: object\n",
"Stembureau 17\n",
"Adres \n",
"Locatie SB17\n",
"description Stembureau Mobiel Stembureau dinsdag\n",
"Geldige stemmen 115\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 8318, Length: 973, dtype: object\n",
"Stembureau 228\n",
"Adres \n",
"Locatie SB228\n",
"description Stembureau Stembureau Drive-in\n",
"Geldige stemmen 80\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 9093, Length: 973, dtype: object\n",
"Stembureau 30\n",
"Adres \n",
"Locatie SB30\n",
"description Stembureau Mobiel stembureau\n",
"Geldige stemmen 25\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 9151, Length: 973, dtype: object\n",
"Stembureau 31\n",
"Adres \n",
"Locatie SB31\n",
"description Stembureau Mobiel stembureau\n",
"Geldige stemmen 8\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 9152, Length: 973, dtype: object\n",
"Stembureau 32\n",
"Adres \n",
"Locatie SB32\n",
"description Stembureau Mobiel stembureau\n",
"Geldige stemmen 24\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 9153, Length: 973, dtype: object\n",
"Stembureau 76\n",
"Adres \n",
"Locatie SB76\n",
"description Stembureau Rondvaartboot Toerist VI\n",
"Geldige stemmen 148\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 9661, Length: 973, dtype: object\n",
"Stembureau 68\n",
"Adres \n",
"Locatie SB68\n",
"description Stembureau Drive Inn (evenemententerrein Het L...\n",
"Geldige stemmen 285\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 9853, Length: 973, dtype: object\n",
"Stembureau 14\n",
"Adres \n",
"Locatie SB14\n",
"description Stembureau Mobiel Stembureau\n",
"Geldige stemmen 24\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 10427, Length: 973, dtype: object\n",
"Stembureau 18\n",
"Adres \n",
"Locatie SB18\n",
"description Stembureau Mobiel stembureau\n",
"Geldige stemmen 50\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 10431, Length: 973, dtype: object\n",
"Stembureau 23\n",
"Adres \n",
"Locatie SB23\n",
"description Stembureau Stembureau Mobiel: Wkp Zout Veere\n",
"Geldige stemmen 55\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 10497, Length: 973, dtype: object\n",
"Stembureau 24\n",
"Adres \n",
"Locatie SB24\n",
"description Stembureau Stembureau Mobiel: Okp Dom\n",
"Geldige stemmen 35\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 10498, Length: 973, dtype: object\n",
"Stembureau 115\n",
"Adres \n",
"Locatie SB115\n",
"description Stembureau Tent Nijverheidslaan\n",
"Geldige stemmen 258\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 10525, Length: 973, dtype: object\n",
"Stembureau 116\n",
"Adres \n",
"Locatie SB116\n",
"description Stembureau Tent Nijverheidslaan\n",
"Geldige stemmen 377\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 10526, Length: 973, dtype: object\n",
"Stembureau 117\n",
"Adres \n",
"Locatie SB117\n",
"description Stembureau Tent Peter Benenson park\n",
"Geldige stemmen 285\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 10527, Length: 973, dtype: object\n",
"Stembureau 118\n",
"Adres \n",
"Locatie SB118\n",
"description Stembureau Tent Peter Benenson park\n",
"Geldige stemmen 329\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 10528, Length: 973, dtype: object\n",
"Stembureau 310\n",
"Adres \n",
"Locatie SB310\n",
"description Stembureau Mobiel Bijzonder stembureau 1\n",
"Geldige stemmen 26\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 10623, Length: 973, dtype: object\n",
"Stembureau 311\n",
"Adres \n",
"Locatie SB311\n",
"description Stembureau Mobiel Bijzonder stembureau 2\n",
"Geldige stemmen 55\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 10624, Length: 973, dtype: object\n",
"Stembureau 88\n",
"Adres \n",
"Locatie SB88\n",
"description Stembureau Mobiel stembureau 1\n",
"Geldige stemmen 78\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 10894, Length: 973, dtype: object\n",
"Stembureau 89\n",
"Adres \n",
"Locatie SB89\n",
"description Stembureau Mobiel stembureau 2\n",
"Geldige stemmen 35\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 10895, Length: 973, dtype: object\n",
"Stembureau 31\n",
"Adres \n",
"Locatie SB31\n",
"description Stembureau Stembureau Mobiel Stembureau\n",
"Geldige stemmen 32\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 11032, Length: 973, dtype: object\n",
"Stembureau 0\n",
"Adres \n",
"Locatie SB0\n",
"description Stembureau -\n",
"Geldige stemmen 0\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 11101, Length: 973, dtype: object\n",
"Stembureau 132\n",
"Adres \n",
"Locatie SB132\n",
"description Stembureau Stembureau IJsselhallen drive thoug...\n",
"Geldige stemmen 52\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 12038, Length: 973, dtype: object\n",
"Stembureau 133\n",
"Adres \n",
"Locatie SB133\n",
"description Stembureau Stembureau IJsselhallen drive throu...\n",
"Geldige stemmen 48\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 12039, Length: 973, dtype: object\n",
"Stembureau 232\n",
"Adres \n",
"Locatie SB232\n",
"description Stembureau Stembureau IJsselhallen drive thoug...\n",
"Geldige stemmen 113\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 12053, Length: 973, dtype: object\n",
"Stembureau 233\n",
"Adres \n",
"Locatie SB233\n",
"description Stembureau Stembureau IJsselhallen drive throu...\n",
"Geldige stemmen 73\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 12054, Length: 973, dtype: object\n",
"Stembureau 358\n",
"Adres \n",
"Locatie SB358\n",
"description Stembureau Stembureau Mobiel stembureau 1\n",
"Geldige stemmen 70\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 12118, Length: 973, dtype: object\n",
"Stembureau 359\n",
"Adres \n",
"Locatie SB359\n",
"description Stembureau Stembureau Mobiel stembureau 2\n",
"Geldige stemmen 169\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 12119, Length: 973, dtype: object\n",
"Stembureau 360\n",
"Adres \n",
"Locatie SB360\n",
"description Stembureau Stembureau Mobiel stembureau 3\n",
"Geldige stemmen 89\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 12120, Length: 973, dtype: object\n",
"Stembureau 361\n",
"Adres \n",
"Locatie SB361\n",
"description Stembureau Stembureau Mobiel stembureau 4\n",
"Geldige stemmen 36\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie NaN\n",
"RAADSGROEPERING ''BOSCH-BELANG'' NaN\n",
"gewoon ge-DREVEN NaN\n",
"VOOR Den Bosch Joep Gersjes NaN\n",
"geometry POINT (0 0)\n",
"Name: 12121, Length: 973, dtype: object\n",
"Stembureau 114\n",
"Adres \n",
"Locatie SB114\n",
"description Stembureau Stembureau Mobiel stembureau (beper...\n",
"Geldige stemmen 109\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie 11.0\n",
"RAADSGROEPERING ''BOSCH-BELANG'' 8.0\n",
"gewoon ge-DREVEN 0.0\n",
"VOOR Den Bosch Joep Gersjes 1.0\n",
"geometry POINT (0 0)\n",
"Name: 12504, Length: 973, dtype: object\n",
"Stembureau 115\n",
"Adres \n",
"Locatie SB115\n",
"description Stembureau Stembureau Mobiel Stembureau (beper...\n",
"Geldige stemmen 80\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie 9.0\n",
"RAADSGROEPERING ''BOSCH-BELANG'' 5.0\n",
"gewoon ge-DREVEN 0.0\n",
"VOOR Den Bosch Joep Gersjes 3.0\n",
"geometry POINT (0 0)\n",
"Name: 12505, Length: 973, dtype: object\n",
"Stembureau 116\n",
"Adres \n",
"Locatie SB116\n",
"description Stembureau Stembureau Mobiel Stembureau (beper...\n",
"Geldige stemmen 119\n",
" ... \n",
"\"Leefbaar 's-Hertogenbosch\" Paul Kagie 3.0\n",
"RAADSGROEPERING ''BOSCH-BELANG'' 3.0\n",
"gewoon ge-DREVEN 20.0\n",
"VOOR Den Bosch Joep Gersjes 3.0\n",
"geometry POINT (0 0)\n",
"Name: 12506, Length: 973, dtype: object\n"
2022-03-30 15:43:08 +02:00
]
2022-03-29 17:09:52 +02:00
}
],
2022-04-04 15:09:40 +02:00
"source": [
"for index, row in df_geojson.iterrows():\n",
" if (row.geometry.centroid.x == 0.00000):\n",
" print(row)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2022-04-20 13:03:38 +02:00
"Het zijn dus duidelijk allemaal mobiele stemlokalen, die kunnen we in een aparte dataset houden voor later, voor nu zijn ze onbelangrijk voor de kaartweergave, laten we de dataset dus opsplitsen in drie dataframes, de originele, één frame zonder de mobiele stemlokalen, en de mobiele stemlokalen alleen."
2022-04-04 15:09:40 +02:00
]
},
{
"cell_type": "code",
2022-04-14 15:43:51 +02:00
"execution_count": 6,
2022-04-04 15:09:40 +02:00
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
2022-04-20 13:03:38 +02:00
"/tmp/ipykernel_42724/291552514.py:3: UserWarning: Geometry is in a geographic CRS. Results from 'centroid' are likely incorrect. Use 'GeoSeries.to_crs()' to re-project geometries to a projected CRS before this operation.\n",
2022-04-04 15:09:40 +02:00
"\n",
" mobiel_mask = df_geojson['geometry'].centroid.x == 0\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"2520\n",
"2521\n",
"2918\n",
"3579\n",
"3580\n",
"3581\n",
"3582\n",
"3583\n",
"5494\n",
"5784\n",
"5785\n",
"6260\n",
"6261\n",
"6738\n",
"6739\n",
"6863\n",
"7348\n",
"7364\n",
"7857\n",
"7912\n",
"7913\n",
"7923\n",
"7924\n",
"7926\n",
"7958\n",
"7959\n",
"7960\n",
"8108\n",
"8109\n",
"8161\n",
"8162\n",
"8163\n",
"8318\n",
"9093\n",
"9151\n",
"9152\n",
"9153\n",
"9661\n",
"9853\n",
"10427\n",
"10431\n",
"10497\n",
"10498\n",
"10525\n",
"10526\n",
"10527\n",
"10528\n",
"10623\n",
"10624\n",
"10894\n",
"10895\n",
"11032\n",
"11101\n",
"12038\n",
"12039\n",
"12053\n",
"12054\n",
"12118\n",
"12119\n",
"12120\n",
"12121\n",
"12504\n",
"12505\n",
"12506\n"
]
}
],
"source": [
"#de waarschuwing over de projectie die niet klopt kan genegeerd worden, we zoeken naar data die x = 0 is, de projectie gaat geen effect hebben op die data in Nederland\n",
"#filter de data en print welke waardes 0 hebben op x\n",
"mobiel_mask = df_geojson['geometry'].centroid.x == 0\n",
"i = 0\n",
"for item in mobiel_mask:\n",
" if item:\n",
" print(i)\n",
" i = i + 1"
]
},
{
"cell_type": "code",
2022-04-14 15:43:51 +02:00
"execution_count": 7,
2022-04-04 15:09:40 +02:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
2022-04-13 15:08:29 +02:00
" Stembureau Adres Locatie \\\n",
"0 1 9461BH SB1 \n",
"1 2 9461DA SB2 \n",
"2 3 9461JA SB3 \n",
"3 4 9451KD SB4 \n",
"4 6 9454PL SB6 \n",
"... ... ... ... \n",
"12591 703 5391AR SB703 \n",
"12592 705 5391AR SB705 \n",
"12593 750 5382KE SB750 \n",
"12594 751 5382KE SB751 \n",
"12595 752 5283KE SB752 \n",
2022-04-04 15:09:40 +02:00
"\n",
" description Geldige stemmen \\\n",
2022-04-13 15:08:29 +02:00
"0 Stembureau Gemeentehuis Gieten (postcode: 9461... 784 \n",
"1 Stembureau OBS Gieten (postcode: 9461 DA) 562 \n",
"2 Stembureau Zorgcentrum Dekelhem (postcode: 946... 566 \n",
"3 Stembureau Ontmoetingscentrum Boerhorn Rolde (... 1495 \n",
"4 Stembureau Dropshuis de Eekhof (postcode: 9454... 347 \n",
2022-04-04 15:09:40 +02:00
"... ... ... \n",
2022-04-13 15:08:29 +02:00
"12591 Stembureau Stembureau Gemeenschapshuis de Meen... 268 \n",
"12592 Stembureau Stembureau Gemeenschapshuis De Meen... 398 \n",
"12593 Stembureau Stembureau Gemeenschapshuis 't Zijl... 663 \n",
"12594 Stembureau Stembureau Gemeenschapshuis 't Zijl... 170 \n",
"12595 Stembureau Stembureau Gemeenschapshuis 't Zijl... 222 \n",
2022-04-04 15:09:40 +02:00
"\n",
" Opgeroepen Ongeldig Blanco Geldige stempassen \\\n",
2022-04-13 15:08:29 +02:00
"0 2780 3 3 700 \n",
"1 1396 0 0 518 \n",
"2 1409 2 2 516 \n",
"3 2209 2 4 1335 \n",
"4 477 0 2 298 \n",
2022-04-04 15:09:40 +02:00
"... ... ... ... ... \n",
2022-04-13 15:08:29 +02:00
"12591 0 0 1 237 \n",
"12592 0 1 0 359 \n",
"12593 2321 2 0 552 \n",
"12594 0 0 0 151 \n",
"12595 0 0 0 193 \n",
2022-04-04 15:09:40 +02:00
"\n",
" Geldige volmachtbewijzen ... \\\n",
2022-04-13 15:08:29 +02:00
"0 90 ... \n",
"1 44 ... \n",
"2 54 ... \n",
"3 166 ... \n",
"4 51 ... \n",
2022-04-04 15:09:40 +02:00
"... ... ... \n",
2022-04-13 15:08:29 +02:00
"12591 32 ... \n",
"12592 40 ... \n",
"12593 113 ... \n",
"12594 19 ... \n",
"12595 29 ... \n",
2022-04-04 15:09:40 +02:00
"\n",
" Nationale Bond tegen Overheidszaken - DH Haags Belang INL Den Haag \\\n",
2022-04-13 15:08:29 +02:00
"0 NaN NaN NaN \n",
"1 NaN NaN NaN \n",
"2 NaN NaN NaN \n",
"3 NaN NaN NaN \n",
"4 NaN NaN NaN \n",
2022-04-04 15:09:40 +02:00
"... ... ... ... \n",
2022-04-13 15:08:29 +02:00
"12591 NaN NaN NaN \n",
"12592 NaN NaN NaN \n",
"12593 NaN NaN NaN \n",
"12594 NaN NaN NaN \n",
"12595 NaN NaN NaN \n",
2022-04-04 15:09:40 +02:00
"\n",
" Rosmalens Belang De Bossche Groenen \\\n",
2022-04-13 15:08:29 +02:00
"0 NaN NaN \n",
"1 NaN NaN \n",
"2 NaN NaN \n",
"3 NaN NaN \n",
"4 NaN NaN \n",
2022-04-04 15:09:40 +02:00
"... ... ... \n",
2022-04-13 15:08:29 +02:00
"12591 105.0 2.0 \n",
"12592 174.0 6.0 \n",
"12593 47.0 19.0 \n",
"12594 8.0 11.0 \n",
"12595 10.0 2.0 \n",
2022-04-04 15:09:40 +02:00
"\n",
" \"Leefbaar 's-Hertogenbosch\" Paul Kagie \\\n",
2022-04-13 15:08:29 +02:00
"0 NaN \n",
"1 NaN \n",
"2 NaN \n",
"3 NaN \n",
"4 NaN \n",
2022-04-04 15:09:40 +02:00
"... ... \n",
2022-04-13 15:08:29 +02:00
"12591 6.0 \n",
"12592 2.0 \n",
"12593 53.0 \n",
"12594 13.0 \n",
"12595 22.0 \n",
2022-04-04 15:09:40 +02:00
"\n",
" RAADSGROEPERING ''BOSCH-BELANG'' gewoon ge-DREVEN \\\n",
2022-04-13 15:08:29 +02:00
"0 NaN NaN \n",
"1 NaN NaN \n",
"2 NaN NaN \n",
"3 NaN NaN \n",
"4 NaN NaN \n",
2022-04-04 15:09:40 +02:00
"... ... ... \n",
2022-04-13 15:08:29 +02:00
"12591 0.0 33.0 \n",
"12592 3.0 31.0 \n",
"12593 2.0 62.0 \n",
"12594 1.0 22.0 \n",
"12595 2.0 28.0 \n",
2022-04-04 15:09:40 +02:00
"\n",
2022-04-13 15:08:29 +02:00
" VOOR Den Bosch Joep Gersjes geometry \n",
"0 NaN POINT (6.75899 53.00524) \n",
"1 NaN POINT (6.75990 52.99975) \n",
"2 NaN POINT (6.76600 53.00494) \n",
"3 NaN POINT (6.64736 52.98281) \n",
"4 NaN POINT (6.60459 52.95269) \n",
"... ... ... \n",
"12591 0.0 POINT (5.43290 51.72810) \n",
"12592 2.0 POINT (5.43290 51.72810) \n",
"12593 5.0 POINT (5.45919 51.70595) \n",
"12594 1.0 POINT (5.45919 51.70595) \n",
"12595 0.0 POINT (5.45919 51.70595) \n",
2022-04-04 15:09:40 +02:00
"\n",
2022-04-13 15:08:29 +02:00
"[12532 rows x 973 columns]\n"
2022-04-04 15:09:40 +02:00
]
}
],
"source": [
"df_geojson_clean = df_geojson[~mobiel_mask]\n",
"df_geojson_mobiel = df_geojson[mobiel_mask]\n",
2022-04-13 15:08:29 +02:00
"print(df_geojson_clean)"
2022-04-04 15:09:40 +02:00
]
},
{
"cell_type": "code",
2022-04-14 15:43:51 +02:00
"execution_count": 8,
2022-04-04 15:09:40 +02:00
"metadata": {},
2022-04-20 13:03:38 +02:00
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Stembureau</th>\n",
" <th>Adres</th>\n",
" <th>Locatie</th>\n",
" <th>description</th>\n",
" <th>Geldige stemmen</th>\n",
" <th>Opgeroepen</th>\n",
" <th>Ongeldig</th>\n",
" <th>Blanco</th>\n",
" <th>Geldige stempassen</th>\n",
" <th>Geldige volmachtbewijzen</th>\n",
" <th>...</th>\n",
" <th>Nationale Bond tegen Overheidszaken - DH</th>\n",
" <th>Haags Belang</th>\n",
" <th>INL Den Haag</th>\n",
" <th>Rosmalens Belang</th>\n",
" <th>De Bossche Groenen</th>\n",
" <th>\"Leefbaar 's-Hertogenbosch\" Paul Kagie</th>\n",
" <th>RAADSGROEPERING ''BOSCH-BELANG''</th>\n",
" <th>gewoon ge-DREVEN</th>\n",
" <th>VOOR Den Bosch Joep Gersjes</th>\n",
" <th>geometry</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>1</td>\n",
" <td>9461BH</td>\n",
" <td>SB1</td>\n",
" <td>Stembureau Gemeentehuis Gieten (postcode: 9461...</td>\n",
" <td>784</td>\n",
" <td>2780</td>\n",
" <td>3</td>\n",
" <td>3</td>\n",
" <td>700</td>\n",
" <td>90</td>\n",
" <td>...</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>POINT (6.75899 53.00524)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>2</td>\n",
" <td>9461DA</td>\n",
" <td>SB2</td>\n",
" <td>Stembureau OBS Gieten (postcode: 9461 DA)</td>\n",
" <td>562</td>\n",
" <td>1396</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>518</td>\n",
" <td>44</td>\n",
" <td>...</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>POINT (6.75990 52.99975)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>3</td>\n",
" <td>9461JA</td>\n",
" <td>SB3</td>\n",
" <td>Stembureau Zorgcentrum Dekelhem (postcode: 946...</td>\n",
" <td>566</td>\n",
" <td>1409</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>516</td>\n",
" <td>54</td>\n",
" <td>...</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>POINT (6.76600 53.00494)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>4</td>\n",
" <td>9451KD</td>\n",
" <td>SB4</td>\n",
" <td>Stembureau Ontmoetingscentrum Boerhorn Rolde (...</td>\n",
" <td>1495</td>\n",
" <td>2209</td>\n",
" <td>2</td>\n",
" <td>4</td>\n",
" <td>1335</td>\n",
" <td>166</td>\n",
" <td>...</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>POINT (6.64736 52.98281)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>6</td>\n",
" <td>9454PL</td>\n",
" <td>SB6</td>\n",
" <td>Stembureau Dropshuis de Eekhof (postcode: 9454...</td>\n",
" <td>347</td>\n",
" <td>477</td>\n",
" <td>0</td>\n",
" <td>2</td>\n",
" <td>298</td>\n",
" <td>51</td>\n",
" <td>...</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>POINT (6.60459 52.95269)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12591</th>\n",
" <td>703</td>\n",
" <td>5391AR</td>\n",
" <td>SB703</td>\n",
" <td>Stembureau Stembureau Gemeenschapshuis de Meen...</td>\n",
" <td>268</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>237</td>\n",
" <td>32</td>\n",
" <td>...</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>105.0</td>\n",
" <td>2.0</td>\n",
" <td>6.0</td>\n",
" <td>0.0</td>\n",
" <td>33.0</td>\n",
" <td>0.0</td>\n",
" <td>POINT (5.43290 51.72810)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12592</th>\n",
" <td>705</td>\n",
" <td>5391AR</td>\n",
" <td>SB705</td>\n",
" <td>Stembureau Stembureau Gemeenschapshuis De Meen...</td>\n",
" <td>398</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>359</td>\n",
" <td>40</td>\n",
" <td>...</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>174.0</td>\n",
" <td>6.0</td>\n",
" <td>2.0</td>\n",
" <td>3.0</td>\n",
" <td>31.0</td>\n",
" <td>2.0</td>\n",
" <td>POINT (5.43290 51.72810)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12593</th>\n",
" <td>750</td>\n",
" <td>5382KE</td>\n",
" <td>SB750</td>\n",
" <td>Stembureau Stembureau Gemeenschapshuis 't Zijl...</td>\n",
" <td>663</td>\n",
" <td>2321</td>\n",
" <td>2</td>\n",
" <td>0</td>\n",
" <td>552</td>\n",
" <td>113</td>\n",
" <td>...</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>47.0</td>\n",
" <td>19.0</td>\n",
" <td>53.0</td>\n",
" <td>2.0</td>\n",
" <td>62.0</td>\n",
" <td>5.0</td>\n",
" <td>POINT (5.45919 51.70595)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12594</th>\n",
" <td>751</td>\n",
" <td>5382KE</td>\n",
" <td>SB751</td>\n",
" <td>Stembureau Stembureau Gemeenschapshuis 't Zijl...</td>\n",
" <td>170</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>151</td>\n",
" <td>19</td>\n",
" <td>...</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>8.0</td>\n",
" <td>11.0</td>\n",
" <td>13.0</td>\n",
" <td>1.0</td>\n",
" <td>22.0</td>\n",
" <td>1.0</td>\n",
" <td>POINT (5.45919 51.70595)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12595</th>\n",
" <td>752</td>\n",
" <td>5283KE</td>\n",
" <td>SB752</td>\n",
" <td>Stembureau Stembureau Gemeenschapshuis 't Zijl...</td>\n",
" <td>222</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>193</td>\n",
" <td>29</td>\n",
" <td>...</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>10.0</td>\n",
" <td>2.0</td>\n",
" <td>22.0</td>\n",
" <td>2.0</td>\n",
" <td>28.0</td>\n",
" <td>0.0</td>\n",
" <td>POINT (5.45919 51.70595)</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>12416 rows × 973 columns</p>\n",
"</div>"
],
"text/plain": [
" Stembureau Adres Locatie \\\n",
"0 1 9461BH SB1 \n",
"1 2 9461DA SB2 \n",
"2 3 9461JA SB3 \n",
"3 4 9451KD SB4 \n",
"4 6 9454PL SB6 \n",
"... ... ... ... \n",
"12591 703 5391AR SB703 \n",
"12592 705 5391AR SB705 \n",
"12593 750 5382KE SB750 \n",
"12594 751 5382KE SB751 \n",
"12595 752 5283KE SB752 \n",
"\n",
" description Geldige stemmen \\\n",
"0 Stembureau Gemeentehuis Gieten (postcode: 9461... 784 \n",
"1 Stembureau OBS Gieten (postcode: 9461 DA) 562 \n",
"2 Stembureau Zorgcentrum Dekelhem (postcode: 946... 566 \n",
"3 Stembureau Ontmoetingscentrum Boerhorn Rolde (... 1495 \n",
"4 Stembureau Dropshuis de Eekhof (postcode: 9454... 347 \n",
"... ... ... \n",
"12591 Stembureau Stembureau Gemeenschapshuis de Meen... 268 \n",
"12592 Stembureau Stembureau Gemeenschapshuis De Meen... 398 \n",
"12593 Stembureau Stembureau Gemeenschapshuis 't Zijl... 663 \n",
"12594 Stembureau Stembureau Gemeenschapshuis 't Zijl... 170 \n",
"12595 Stembureau Stembureau Gemeenschapshuis 't Zijl... 222 \n",
"\n",
" Opgeroepen Ongeldig Blanco Geldige stempassen \\\n",
"0 2780 3 3 700 \n",
"1 1396 0 0 518 \n",
"2 1409 2 2 516 \n",
"3 2209 2 4 1335 \n",
"4 477 0 2 298 \n",
"... ... ... ... ... \n",
"12591 0 0 1 237 \n",
"12592 0 1 0 359 \n",
"12593 2321 2 0 552 \n",
"12594 0 0 0 151 \n",
"12595 0 0 0 193 \n",
"\n",
" Geldige volmachtbewijzen ... \\\n",
"0 90 ... \n",
"1 44 ... \n",
"2 54 ... \n",
"3 166 ... \n",
"4 51 ... \n",
"... ... ... \n",
"12591 32 ... \n",
"12592 40 ... \n",
"12593 113 ... \n",
"12594 19 ... \n",
"12595 29 ... \n",
"\n",
" Nationale Bond tegen Overheidszaken - DH Haags Belang INL Den Haag \\\n",
"0 NaN NaN NaN \n",
"1 NaN NaN NaN \n",
"2 NaN NaN NaN \n",
"3 NaN NaN NaN \n",
"4 NaN NaN NaN \n",
"... ... ... ... \n",
"12591 NaN NaN NaN \n",
"12592 NaN NaN NaN \n",
"12593 NaN NaN NaN \n",
"12594 NaN NaN NaN \n",
"12595 NaN NaN NaN \n",
"\n",
" Rosmalens Belang De Bossche Groenen \\\n",
"0 NaN NaN \n",
"1 NaN NaN \n",
"2 NaN NaN \n",
"3 NaN NaN \n",
"4 NaN NaN \n",
"... ... ... \n",
"12591 105.0 2.0 \n",
"12592 174.0 6.0 \n",
"12593 47.0 19.0 \n",
"12594 8.0 11.0 \n",
"12595 10.0 2.0 \n",
"\n",
" \"Leefbaar 's-Hertogenbosch\" Paul Kagie \\\n",
"0 NaN \n",
"1 NaN \n",
"2 NaN \n",
"3 NaN \n",
"4 NaN \n",
"... ... \n",
"12591 6.0 \n",
"12592 2.0 \n",
"12593 53.0 \n",
"12594 13.0 \n",
"12595 22.0 \n",
"\n",
" RAADSGROEPERING ''BOSCH-BELANG'' gewoon ge-DREVEN \\\n",
"0 NaN NaN \n",
"1 NaN NaN \n",
"2 NaN NaN \n",
"3 NaN NaN \n",
"4 NaN NaN \n",
"... ... ... \n",
"12591 0.0 33.0 \n",
"12592 3.0 31.0 \n",
"12593 2.0 62.0 \n",
"12594 1.0 22.0 \n",
"12595 2.0 28.0 \n",
"\n",
" VOOR Den Bosch Joep Gersjes geometry \n",
"0 NaN POINT (6.75899 53.00524) \n",
"1 NaN POINT (6.75990 52.99975) \n",
"2 NaN POINT (6.76600 53.00494) \n",
"3 NaN POINT (6.64736 52.98281) \n",
"4 NaN POINT (6.60459 52.95269) \n",
"... ... ... \n",
"12591 0.0 POINT (5.43290 51.72810) \n",
"12592 2.0 POINT (5.43290 51.72810) \n",
"12593 5.0 POINT (5.45919 51.70595) \n",
"12594 1.0 POINT (5.45919 51.70595) \n",
"12595 0.0 POINT (5.45919 51.70595) \n",
"\n",
"[12416 rows x 973 columns]"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#let's also check if none fell through the cracks, it might be some mobile polls did actually have a location posted erroneously.\n",
"mobiel_mask_name = df_geojson_clean['description'].str.contains('Mobiel')\n",
"df_geojson_clean = df_geojson_clean[~mobiel_mask_name]\n",
"df_geojson_clean"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>_id</th>\n",
" <th>Gemeente</th>\n",
" <th>CBS gemeentecode</th>\n",
" <th>Nummer stembureau</th>\n",
" <th>Naam stembureau</th>\n",
" <th>Gebruiksdoel van het gebouw</th>\n",
" <th>Website locatie</th>\n",
" <th>Wijknaam</th>\n",
" <th>CBS wijknummer</th>\n",
" <th>Buurtnaam</th>\n",
" <th>...</th>\n",
" <th>Kieskring ID</th>\n",
" <th>Hoofdstembureau</th>\n",
" <th>Tellocatie</th>\n",
" <th>Contactgegevens gemeente</th>\n",
" <th>Verkiezingswebsite gemeente</th>\n",
" <th>Verkiezingen</th>\n",
" <th>ID</th>\n",
" <th>UUID</th>\n",
" <th>Unnamed: 39</th>\n",
" <th>Unnamed: 40</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>1</td>\n",
" <td>Valkenswaard</td>\n",
" <td>GM0858</td>\n",
" <td>1</td>\n",
" <td>Zorgcentrum Kempenhof</td>\n",
" <td>gezondheidszorgfunctie</td>\n",
" <td>https://www.valkenhof.nl/</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>Valkenswaard</td>\n",
" <td>Valkenswaard</td>\n",
" <td>NaN</td>\n",
" <td>verkiezingen@valkenswaard.nl</td>\n",
" <td>http://www.valkenswaard.nl/verkiezingen</td>\n",
" <td>NaN</td>\n",
" <td>NLODSGM0858stembureaus20220316009</td>\n",
" <td>3a612b2151fa4ab491b9e331355e6258</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>2</td>\n",
" <td>Valkenswaard</td>\n",
" <td>GM0858</td>\n",
" <td>2</td>\n",
" <td>Buurtgebouw De Horizon</td>\n",
" <td>bijeenkomstfunctie</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>Valkenswaard</td>\n",
" <td>Valkenswaard</td>\n",
" <td>NaN</td>\n",
" <td>verkiezingen@valkenswaard.nl</td>\n",
" <td>http://www.valkenswaard.nl/verkiezingen</td>\n",
" <td>NaN</td>\n",
" <td>NLODSGM0858stembureaus20220316009</td>\n",
" <td>9a01d765af0a467ea37f08d92db114ba</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>3</td>\n",
" <td>Valkenswaard</td>\n",
" <td>GM0858</td>\n",
" <td>3</td>\n",
" <td>Speeltuin Geenhoven</td>\n",
" <td>bijeenkomstfunctie</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>Valkenswaard</td>\n",
" <td>Valkenswaard</td>\n",
" <td>NaN</td>\n",
" <td>verkiezingen@valkenswaard.nl</td>\n",
" <td>http://www.valkenswaard.nl/verkiezingen</td>\n",
" <td>NaN</td>\n",
" <td>NLODSGM0858stembureaus20220316009</td>\n",
" <td>fc5869d33fbc4b06be659149fa615f4c</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>4</td>\n",
" <td>Valkenswaard</td>\n",
" <td>GM0858</td>\n",
" <td>4</td>\n",
" <td>Ontmoetingscentrum De zoete inval</td>\n",
" <td>bijeenkomstfunctie</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>Valkenswaard</td>\n",
" <td>Valkenswaard</td>\n",
" <td>NaN</td>\n",
" <td>verkiezingen@valkenswaard.nl</td>\n",
" <td>http://www.valkenswaard.nl/verkiezingen</td>\n",
" <td>NaN</td>\n",
" <td>NLODSGM0858stembureaus20220316009</td>\n",
" <td>4427cc0b39e040ba8f75c333f19d66f0</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>5</td>\n",
" <td>Valkenswaard</td>\n",
" <td>GM0858</td>\n",
" <td>5</td>\n",
" <td>Gymnastiekzaal 't Gegraaf</td>\n",
" <td>sportfunctie</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>Valkenswaard</td>\n",
" <td>Valkenswaard</td>\n",
" <td>NaN</td>\n",
" <td>verkiezingen@valkenswaard.nl</td>\n",
" <td>http://www.valkenswaard.nl/verkiezingen</td>\n",
" <td>NaN</td>\n",
" <td>NLODSGM0858stembureaus20220316009</td>\n",
" <td>a893bb9add324ce29769f1c39afcc48d</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9236</th>\n",
" <td>38711</td>\n",
" <td>Putten</td>\n",
" <td>GM0273</td>\n",
" <td>3</td>\n",
" <td>Nieuwe Kerk</td>\n",
" <td>bijeenkomstfunctie</td>\n",
" <td>https://www.hervormdputten.nl/</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>Putten</td>\n",
" <td>Putten</td>\n",
" <td>ja</td>\n",
" <td>verkiezingen@putten.nl</td>\n",
" <td>http://www.putten.nl</td>\n",
" <td>NaN</td>\n",
" <td>NLODSGM0273stembureaus20220316009</td>\n",
" <td>5ce3ef64ced64343b09f03a95d09d275</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9237</th>\n",
" <td>38712</td>\n",
" <td>Putten</td>\n",
" <td>GM0273</td>\n",
" <td>10</td>\n",
" <td>Sporthal de Meeuwen</td>\n",
" <td>sportfunctie</td>\n",
" <td>https://www.kvdemeeuwen.nl/</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>Putten</td>\n",
" <td>Putten</td>\n",
" <td>ja</td>\n",
" <td>verkiezingen@putten.nl</td>\n",
" <td>http://www.putten.nl</td>\n",
" <td>NaN</td>\n",
" <td>NLODSGM0273stembureaus20220316009</td>\n",
" <td>03b7138951f1475b9ca8328ee7365491</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9238</th>\n",
" <td>38713</td>\n",
" <td>Putten</td>\n",
" <td>GM0273</td>\n",
" <td>8</td>\n",
" <td>School de Pelikaan</td>\n",
" <td>onderwijsfunctie</td>\n",
" <td>https://www.pcbdepelikaan.nl/</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>Putten</td>\n",
" <td>Putten</td>\n",
" <td>ja</td>\n",
" <td>verkiezingen@putten.nl</td>\n",
" <td>http://www.putten.nl</td>\n",
" <td>NaN</td>\n",
" <td>NLODSGM0273stembureaus20220316009</td>\n",
" <td>25eb2c3d547a420094ee2f691e8bd383</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9239</th>\n",
" <td>38714</td>\n",
" <td>Putten</td>\n",
" <td>GM0273</td>\n",
" <td>13</td>\n",
" <td>De Samaritaan</td>\n",
" <td>bijeenkomstfunctie,gezondheidszorgfunctie</td>\n",
" <td>https://www.desamaritaanputten.nl/</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>Putten</td>\n",
" <td>Putten</td>\n",
" <td>ja</td>\n",
" <td>verkiezingen@putten.nl</td>\n",
" <td>http://www.putten.nl</td>\n",
" <td>NaN</td>\n",
" <td>NLODSGM0273stembureaus20220316009</td>\n",
" <td>8bc3926806a74105a593e6a133b1306f</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9240</th>\n",
" <td>38715</td>\n",
" <td>Putten</td>\n",
" <td>GM0273</td>\n",
" <td>6</td>\n",
" <td>Verenigingsgebouw Stenenkamer</td>\n",
" <td>bijeenkomstfunctie</td>\n",
" <td>https://verenigingsgebouwsteenenkamer.jouwweb.nl/</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>Putten</td>\n",
" <td>Putten</td>\n",
" <td>ja</td>\n",
" <td>verkiezingen@putten.nl</td>\n",
" <td>http://www.putten.nl</td>\n",
" <td>NaN</td>\n",
" <td>NLODSGM0273stembureaus20220316009</td>\n",
" <td>609fd2e24c5b40b394174a84f7ca91af</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>9241 rows × 41 columns</p>\n",
"</div>"
],
"text/plain": [
" _id Gemeente CBS gemeentecode Nummer stembureau \\\n",
"0 1 Valkenswaard GM0858 1 \n",
"1 2 Valkenswaard GM0858 2 \n",
"2 3 Valkenswaard GM0858 3 \n",
"3 4 Valkenswaard GM0858 4 \n",
"4 5 Valkenswaard GM0858 5 \n",
"... ... ... ... ... \n",
"9236 38711 Putten GM0273 3 \n",
"9237 38712 Putten GM0273 10 \n",
"9238 38713 Putten GM0273 8 \n",
"9239 38714 Putten GM0273 13 \n",
"9240 38715 Putten GM0273 6 \n",
"\n",
" Naam stembureau \\\n",
"0 Zorgcentrum Kempenhof \n",
"1 Buurtgebouw De Horizon \n",
"2 Speeltuin Geenhoven \n",
"3 Ontmoetingscentrum De zoete inval \n",
"4 Gymnastiekzaal 't Gegraaf \n",
"... ... \n",
"9236 Nieuwe Kerk \n",
"9237 Sporthal de Meeuwen \n",
"9238 School de Pelikaan \n",
"9239 De Samaritaan \n",
"9240 Verenigingsgebouw Stenenkamer \n",
"\n",
" Gebruiksdoel van het gebouw \\\n",
"0 gezondheidszorgfunctie \n",
"1 bijeenkomstfunctie \n",
"2 bijeenkomstfunctie \n",
"3 bijeenkomstfunctie \n",
"4 sportfunctie \n",
"... ... \n",
"9236 bijeenkomstfunctie \n",
"9237 sportfunctie \n",
"9238 onderwijsfunctie \n",
"9239 bijeenkomstfunctie,gezondheidszorgfunctie \n",
"9240 bijeenkomstfunctie \n",
"\n",
" Website locatie Wijknaam \\\n",
"0 https://www.valkenhof.nl/ NaN \n",
"1 NaN NaN \n",
"2 NaN NaN \n",
"3 NaN NaN \n",
"4 NaN NaN \n",
"... ... ... \n",
"9236 https://www.hervormdputten.nl/ NaN \n",
"9237 https://www.kvdemeeuwen.nl/ NaN \n",
"9238 https://www.pcbdepelikaan.nl/ NaN \n",
"9239 https://www.desamaritaanputten.nl/ NaN \n",
"9240 https://verenigingsgebouwsteenenkamer.jouwweb.nl/ NaN \n",
"\n",
" CBS wijknummer Buurtnaam ... Kieskring ID Hoofdstembureau \\\n",
"0 NaN NaN ... Valkenswaard Valkenswaard \n",
"1 NaN NaN ... Valkenswaard Valkenswaard \n",
"2 NaN NaN ... Valkenswaard Valkenswaard \n",
"3 NaN NaN ... Valkenswaard Valkenswaard \n",
"4 NaN NaN ... Valkenswaard Valkenswaard \n",
"... ... ... ... ... ... \n",
"9236 NaN NaN ... Putten Putten \n",
"9237 NaN NaN ... Putten Putten \n",
"9238 NaN NaN ... Putten Putten \n",
"9239 NaN NaN ... Putten Putten \n",
"9240 NaN NaN ... Putten Putten \n",
"\n",
" Tellocatie Contactgegevens gemeente \\\n",
"0 NaN verkiezingen@valkenswaard.nl \n",
"1 NaN verkiezingen@valkenswaard.nl \n",
"2 NaN verkiezingen@valkenswaard.nl \n",
"3 NaN verkiezingen@valkenswaard.nl \n",
"4 NaN verkiezingen@valkenswaard.nl \n",
"... ... ... \n",
"9236 ja verkiezingen@putten.nl \n",
"9237 ja verkiezingen@putten.nl \n",
"9238 ja verkiezingen@putten.nl \n",
"9239 ja verkiezingen@putten.nl \n",
"9240 ja verkiezingen@putten.nl \n",
"\n",
" Verkiezingswebsite gemeente Verkiezingen \\\n",
"0 http://www.valkenswaard.nl/verkiezingen NaN \n",
"1 http://www.valkenswaard.nl/verkiezingen NaN \n",
"2 http://www.valkenswaard.nl/verkiezingen NaN \n",
"3 http://www.valkenswaard.nl/verkiezingen NaN \n",
"4 http://www.valkenswaard.nl/verkiezingen NaN \n",
"... ... ... \n",
"9236 http://www.putten.nl NaN \n",
"9237 http://www.putten.nl NaN \n",
"9238 http://www.putten.nl NaN \n",
"9239 http://www.putten.nl NaN \n",
"9240 http://www.putten.nl NaN \n",
"\n",
" ID UUID \\\n",
"0 NLODSGM0858stembureaus20220316009 3a612b2151fa4ab491b9e331355e6258 \n",
"1 NLODSGM0858stembureaus20220316009 9a01d765af0a467ea37f08d92db114ba \n",
"2 NLODSGM0858stembureaus20220316009 fc5869d33fbc4b06be659149fa615f4c \n",
"3 NLODSGM0858stembureaus20220316009 4427cc0b39e040ba8f75c333f19d66f0 \n",
"4 NLODSGM0858stembureaus20220316009 a893bb9add324ce29769f1c39afcc48d \n",
"... ... ... \n",
"9236 NLODSGM0273stembureaus20220316009 5ce3ef64ced64343b09f03a95d09d275 \n",
"9237 NLODSGM0273stembureaus20220316009 03b7138951f1475b9ca8328ee7365491 \n",
"9238 NLODSGM0273stembureaus20220316009 25eb2c3d547a420094ee2f691e8bd383 \n",
"9239 NLODSGM0273stembureaus20220316009 8bc3926806a74105a593e6a133b1306f \n",
"9240 NLODSGM0273stembureaus20220316009 609fd2e24c5b40b394174a84f7ca91af \n",
"\n",
" Unnamed: 39 Unnamed: 40 \n",
"0 NaN NaN \n",
"1 NaN NaN \n",
"2 NaN NaN \n",
"3 NaN NaN \n",
"4 NaN NaN \n",
"... ... ... \n",
"9236 NaN NaN \n",
"9237 NaN NaN \n",
"9238 NaN NaN \n",
"9239 NaN NaN \n",
"9240 NaN NaN \n",
"\n",
"[9241 rows x 41 columns]"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df_wims = pd.read_csv(r'../data/wims.csv')\n",
"df_wims"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>_id</th>\n",
" <th>Gemeente</th>\n",
" <th>CBS gemeentecode</th>\n",
" <th>Nummer stembureau</th>\n",
" <th>Naam stembureau</th>\n",
" <th>Gebruiksdoel van het gebouw</th>\n",
" <th>Website locatie</th>\n",
" <th>Wijknaam</th>\n",
" <th>CBS wijknummer</th>\n",
" <th>Buurtnaam</th>\n",
" <th>...</th>\n",
" <th>Hoofdstembureau</th>\n",
" <th>Tellocatie</th>\n",
" <th>Contactgegevens gemeente</th>\n",
" <th>Verkiezingswebsite gemeente</th>\n",
" <th>Verkiezingen</th>\n",
" <th>ID</th>\n",
" <th>UUID</th>\n",
" <th>Unnamed: 39</th>\n",
" <th>Unnamed: 40</th>\n",
" <th>geometry</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>1</td>\n",
" <td>Valkenswaard</td>\n",
" <td>GM0858</td>\n",
" <td>1</td>\n",
" <td>Zorgcentrum Kempenhof</td>\n",
" <td>gezondheidszorgfunctie</td>\n",
" <td>https://www.valkenhof.nl/</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>Valkenswaard</td>\n",
" <td>NaN</td>\n",
" <td>verkiezingen@valkenswaard.nl</td>\n",
" <td>http://www.valkenswaard.nl/verkiezingen</td>\n",
" <td>NaN</td>\n",
" <td>NLODSGM0858stembureaus20220316009</td>\n",
" <td>3a612b2151fa4ab491b9e331355e6258</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>POINT (5.45515 51.34711)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>2</td>\n",
" <td>Valkenswaard</td>\n",
" <td>GM0858</td>\n",
" <td>2</td>\n",
" <td>Buurtgebouw De Horizon</td>\n",
" <td>bijeenkomstfunctie</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>Valkenswaard</td>\n",
" <td>NaN</td>\n",
" <td>verkiezingen@valkenswaard.nl</td>\n",
" <td>http://www.valkenswaard.nl/verkiezingen</td>\n",
" <td>NaN</td>\n",
" <td>NLODSGM0858stembureaus20220316009</td>\n",
" <td>9a01d765af0a467ea37f08d92db114ba</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>POINT (5.45137 51.34955)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>3</td>\n",
" <td>Valkenswaard</td>\n",
" <td>GM0858</td>\n",
" <td>3</td>\n",
" <td>Speeltuin Geenhoven</td>\n",
" <td>bijeenkomstfunctie</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>Valkenswaard</td>\n",
" <td>NaN</td>\n",
" <td>verkiezingen@valkenswaard.nl</td>\n",
" <td>http://www.valkenswaard.nl/verkiezingen</td>\n",
" <td>NaN</td>\n",
" <td>NLODSGM0858stembureaus20220316009</td>\n",
" <td>fc5869d33fbc4b06be659149fa615f4c</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>POINT (5.44827 51.35702)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>4</td>\n",
" <td>Valkenswaard</td>\n",
" <td>GM0858</td>\n",
" <td>4</td>\n",
" <td>Ontmoetingscentrum De zoete inval</td>\n",
" <td>bijeenkomstfunctie</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>Valkenswaard</td>\n",
" <td>NaN</td>\n",
" <td>verkiezingen@valkenswaard.nl</td>\n",
" <td>http://www.valkenswaard.nl/verkiezingen</td>\n",
" <td>NaN</td>\n",
" <td>NLODSGM0858stembureaus20220316009</td>\n",
" <td>4427cc0b39e040ba8f75c333f19d66f0</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>POINT (5.44871 51.36022)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>5</td>\n",
" <td>Valkenswaard</td>\n",
" <td>GM0858</td>\n",
" <td>5</td>\n",
" <td>Gymnastiekzaal 't Gegraaf</td>\n",
" <td>sportfunctie</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>Valkenswaard</td>\n",
" <td>NaN</td>\n",
" <td>verkiezingen@valkenswaard.nl</td>\n",
" <td>http://www.valkenswaard.nl/verkiezingen</td>\n",
" <td>NaN</td>\n",
" <td>NLODSGM0858stembureaus20220316009</td>\n",
" <td>a893bb9add324ce29769f1c39afcc48d</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>POINT (5.45331 51.36514)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9236</th>\n",
" <td>38711</td>\n",
" <td>Putten</td>\n",
" <td>GM0273</td>\n",
" <td>3</td>\n",
" <td>Nieuwe Kerk</td>\n",
" <td>bijeenkomstfunctie</td>\n",
" <td>https://www.hervormdputten.nl/</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>Putten</td>\n",
" <td>ja</td>\n",
" <td>verkiezingen@putten.nl</td>\n",
" <td>http://www.putten.nl</td>\n",
" <td>NaN</td>\n",
" <td>NLODSGM0273stembureaus20220316009</td>\n",
" <td>5ce3ef64ced64343b09f03a95d09d275</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>POINT (5.60654 52.25587)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9237</th>\n",
" <td>38712</td>\n",
" <td>Putten</td>\n",
" <td>GM0273</td>\n",
" <td>10</td>\n",
" <td>Sporthal de Meeuwen</td>\n",
" <td>sportfunctie</td>\n",
" <td>https://www.kvdemeeuwen.nl/</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>Putten</td>\n",
" <td>ja</td>\n",
" <td>verkiezingen@putten.nl</td>\n",
" <td>http://www.putten.nl</td>\n",
" <td>NaN</td>\n",
" <td>NLODSGM0273stembureaus20220316009</td>\n",
" <td>03b7138951f1475b9ca8328ee7365491</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>POINT (5.59487 52.24865)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9238</th>\n",
" <td>38713</td>\n",
" <td>Putten</td>\n",
" <td>GM0273</td>\n",
" <td>8</td>\n",
" <td>School de Pelikaan</td>\n",
" <td>onderwijsfunctie</td>\n",
" <td>https://www.pcbdepelikaan.nl/</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>Putten</td>\n",
" <td>ja</td>\n",
" <td>verkiezingen@putten.nl</td>\n",
" <td>http://www.putten.nl</td>\n",
" <td>NaN</td>\n",
" <td>NLODSGM0273stembureaus20220316009</td>\n",
" <td>25eb2c3d547a420094ee2f691e8bd383</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>POINT (5.59278 52.25561)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9239</th>\n",
" <td>38714</td>\n",
" <td>Putten</td>\n",
" <td>GM0273</td>\n",
" <td>13</td>\n",
" <td>De Samaritaan</td>\n",
" <td>bijeenkomstfunctie,gezondheidszorgfunctie</td>\n",
" <td>https://www.desamaritaanputten.nl/</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>Putten</td>\n",
" <td>ja</td>\n",
" <td>verkiezingen@putten.nl</td>\n",
" <td>http://www.putten.nl</td>\n",
" <td>NaN</td>\n",
" <td>NLODSGM0273stembureaus20220316009</td>\n",
" <td>8bc3926806a74105a593e6a133b1306f</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>POINT (5.58088 52.26092)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9240</th>\n",
" <td>38715</td>\n",
" <td>Putten</td>\n",
" <td>GM0273</td>\n",
" <td>6</td>\n",
" <td>Verenigingsgebouw Stenenkamer</td>\n",
" <td>bijeenkomstfunctie</td>\n",
" <td>https://verenigingsgebouwsteenenkamer.jouwweb.nl/</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>Putten</td>\n",
" <td>ja</td>\n",
" <td>verkiezingen@putten.nl</td>\n",
" <td>http://www.putten.nl</td>\n",
" <td>NaN</td>\n",
" <td>NLODSGM0273stembureaus20220316009</td>\n",
" <td>609fd2e24c5b40b394174a84f7ca91af</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>POINT (5.54537 52.26266)</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>9241 rows × 42 columns</p>\n",
"</div>"
],
"text/plain": [
" _id Gemeente CBS gemeentecode Nummer stembureau \\\n",
"0 1 Valkenswaard GM0858 1 \n",
"1 2 Valkenswaard GM0858 2 \n",
"2 3 Valkenswaard GM0858 3 \n",
"3 4 Valkenswaard GM0858 4 \n",
"4 5 Valkenswaard GM0858 5 \n",
"... ... ... ... ... \n",
"9236 38711 Putten GM0273 3 \n",
"9237 38712 Putten GM0273 10 \n",
"9238 38713 Putten GM0273 8 \n",
"9239 38714 Putten GM0273 13 \n",
"9240 38715 Putten GM0273 6 \n",
"\n",
" Naam stembureau \\\n",
"0 Zorgcentrum Kempenhof \n",
"1 Buurtgebouw De Horizon \n",
"2 Speeltuin Geenhoven \n",
"3 Ontmoetingscentrum De zoete inval \n",
"4 Gymnastiekzaal 't Gegraaf \n",
"... ... \n",
"9236 Nieuwe Kerk \n",
"9237 Sporthal de Meeuwen \n",
"9238 School de Pelikaan \n",
"9239 De Samaritaan \n",
"9240 Verenigingsgebouw Stenenkamer \n",
"\n",
" Gebruiksdoel van het gebouw \\\n",
"0 gezondheidszorgfunctie \n",
"1 bijeenkomstfunctie \n",
"2 bijeenkomstfunctie \n",
"3 bijeenkomstfunctie \n",
"4 sportfunctie \n",
"... ... \n",
"9236 bijeenkomstfunctie \n",
"9237 sportfunctie \n",
"9238 onderwijsfunctie \n",
"9239 bijeenkomstfunctie,gezondheidszorgfunctie \n",
"9240 bijeenkomstfunctie \n",
"\n",
" Website locatie Wijknaam \\\n",
"0 https://www.valkenhof.nl/ NaN \n",
"1 NaN NaN \n",
"2 NaN NaN \n",
"3 NaN NaN \n",
"4 NaN NaN \n",
"... ... ... \n",
"9236 https://www.hervormdputten.nl/ NaN \n",
"9237 https://www.kvdemeeuwen.nl/ NaN \n",
"9238 https://www.pcbdepelikaan.nl/ NaN \n",
"9239 https://www.desamaritaanputten.nl/ NaN \n",
"9240 https://verenigingsgebouwsteenenkamer.jouwweb.nl/ NaN \n",
"\n",
" CBS wijknummer Buurtnaam ... Hoofdstembureau Tellocatie \\\n",
"0 NaN NaN ... Valkenswaard NaN \n",
"1 NaN NaN ... Valkenswaard NaN \n",
"2 NaN NaN ... Valkenswaard NaN \n",
"3 NaN NaN ... Valkenswaard NaN \n",
"4 NaN NaN ... Valkenswaard NaN \n",
"... ... ... ... ... ... \n",
"9236 NaN NaN ... Putten ja \n",
"9237 NaN NaN ... Putten ja \n",
"9238 NaN NaN ... Putten ja \n",
"9239 NaN NaN ... Putten ja \n",
"9240 NaN NaN ... Putten ja \n",
"\n",
" Contactgegevens gemeente Verkiezingswebsite gemeente \\\n",
"0 verkiezingen@valkenswaard.nl http://www.valkenswaard.nl/verkiezingen \n",
"1 verkiezingen@valkenswaard.nl http://www.valkenswaard.nl/verkiezingen \n",
"2 verkiezingen@valkenswaard.nl http://www.valkenswaard.nl/verkiezingen \n",
"3 verkiezingen@valkenswaard.nl http://www.valkenswaard.nl/verkiezingen \n",
"4 verkiezingen@valkenswaard.nl http://www.valkenswaard.nl/verkiezingen \n",
"... ... ... \n",
"9236 verkiezingen@putten.nl http://www.putten.nl \n",
"9237 verkiezingen@putten.nl http://www.putten.nl \n",
"9238 verkiezingen@putten.nl http://www.putten.nl \n",
"9239 verkiezingen@putten.nl http://www.putten.nl \n",
"9240 verkiezingen@putten.nl http://www.putten.nl \n",
"\n",
" Verkiezingen ID \\\n",
"0 NaN NLODSGM0858stembureaus20220316009 \n",
"1 NaN NLODSGM0858stembureaus20220316009 \n",
"2 NaN NLODSGM0858stembureaus20220316009 \n",
"3 NaN NLODSGM0858stembureaus20220316009 \n",
"4 NaN NLODSGM0858stembureaus20220316009 \n",
"... ... ... \n",
"9236 NaN NLODSGM0273stembureaus20220316009 \n",
"9237 NaN NLODSGM0273stembureaus20220316009 \n",
"9238 NaN NLODSGM0273stembureaus20220316009 \n",
"9239 NaN NLODSGM0273stembureaus20220316009 \n",
"9240 NaN NLODSGM0273stembureaus20220316009 \n",
"\n",
" UUID Unnamed: 39 Unnamed: 40 \\\n",
"0 3a612b2151fa4ab491b9e331355e6258 NaN NaN \n",
"1 9a01d765af0a467ea37f08d92db114ba NaN NaN \n",
"2 fc5869d33fbc4b06be659149fa615f4c NaN NaN \n",
"3 4427cc0b39e040ba8f75c333f19d66f0 NaN NaN \n",
"4 a893bb9add324ce29769f1c39afcc48d NaN NaN \n",
"... ... ... ... \n",
"9236 5ce3ef64ced64343b09f03a95d09d275 NaN NaN \n",
"9237 03b7138951f1475b9ca8328ee7365491 NaN NaN \n",
"9238 25eb2c3d547a420094ee2f691e8bd383 NaN NaN \n",
"9239 8bc3926806a74105a593e6a133b1306f NaN NaN \n",
"9240 609fd2e24c5b40b394174a84f7ca91af NaN NaN \n",
"\n",
" geometry \n",
"0 POINT (5.45515 51.34711) \n",
"1 POINT (5.45137 51.34955) \n",
"2 POINT (5.44827 51.35702) \n",
"3 POINT (5.44871 51.36022) \n",
"4 POINT (5.45331 51.36514) \n",
"... ... \n",
"9236 POINT (5.60654 52.25587) \n",
"9237 POINT (5.59487 52.24865) \n",
"9238 POINT (5.59278 52.25561) \n",
"9239 POINT (5.58088 52.26092) \n",
"9240 POINT (5.54537 52.26266) \n",
"\n",
"[9241 rows x 42 columns]"
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"\n",
"gdf_wims = gpd.GeoDataFrame(\n",
" df_wims, geometry=gpd.points_from_xy(df_wims.Longitude, df_wims.Latitude)).set_crs(epsg=4326, inplace=True)\n",
"\n",
"gdf_wims"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
2022-04-04 15:09:40 +02:00
"outputs": [
{
"data": {
"text/plain": [
"<AxesSubplot:>"
]
},
2022-04-20 13:03:38 +02:00
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAuIAAANOCAYAAABUSmkeAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAEAAElEQVR4nOz9e5Qc5Znmiz5xz0uVLqUqyUgIXEKyjZlZyLYEtGTslgEbg+0Zrz09M55taMuNmRmamWnbZ9bZs73O2WftvT3rzO4BYw9D763GjQ309JzTpzd7tdsYX2i1L8IIyW6pZ7VxG4EskIRUN0lVeYvIuJw/Ul9UXL4v4ovIzLqI97cWy1ZVZWZkZGTm873f8z6vEgQBCIIgCIIgCIJYWtTlPgCCIAiCIAiCeCtCQpwgCIIgCIIglgES4gRBEARBEASxDJAQJwiCIAiCIIhlgIQ4QRAEQRAEQSwD+nIfAI/x8fHg7W9/+3IfBkEQBEEQBEH0xc9+9rOZIAgmeL9bkUL87W9/O44ePbrch0EQ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inje76OwFBTmtd7/zGlMN9MNmRN1DU988urUz5kYjwpx1vAZFfhFsCwLtm0Xvt1bHcuyMDk5+Zaxaq0k+rKmEARBEMRKo9Pp4M033wztEkXwfR9zc3OYm5tDtVoNq+TDzF8OgiDlzXYcJ/bvQSaOZCHbwKgoCnzfjwm3GY4IF/3cMIww75vBzgNVwZce27bx+uuv4+1vfztlja8gSIgTBEEQqwbXdTEzM4OZmcHMiGu32zhz5gzOnTuH9evXY/369TBNM8zAZtF87P9H/xP9nPf75d59Zv5
"text/plain": [
"<Figure size 1080x1080 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"fig, ax = plt.subplots(figsize = (15,15))\n",
"nl_map.to_crs(epsg=4326).plot(ax=ax, color='lightgrey')\n",
"gdf_wims.plot(ax=ax)"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<AxesSubplot:>"
]
},
"execution_count": 23,
2022-04-04 15:09:40 +02:00
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
2022-04-20 13:03:38 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAuIAAANOCAYAAABUSmkeAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAEAAElEQVR4nOz9e7Rc1X3ni37netZj6723ZAkJeYNkG3P6SjEIiGTsyICDeSUeJ3067hhi2YTbJnTasdP3nr6+p88d6aZvdydg7KbxaGKHGHCnj5O+nIMdTIyJYjvCCGEH2iPBsQBZ6IG0X5L2rtdatR73j9Jce9Vac641Vz32Q/p9xmDY2ntX1apVq6q+8ze/v++PhWEIgiAIgiAIgiAWFm2xD4AgCIIgCIIgLkZIiBMEQRAEQRDEIkBCnCAIgiAIgiAWARLiBEEQBEEQBLEIkBAnCIIgCIIgiEXAWOwD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EARB5BGGIc6dO4dTp04VasrTNA2rV6/G2rVrl9SWPY/vy/pPRXTnVcTzfh+Hp6Bwr/W+p45jsp5uyByr6njso5tTP+diPC7EecNnXOAXwbZtOI5T+HYXO7ZtY3x8/KKxai0l+rKmEARBEMRSo9Vq4e23347sEkUIggAzMzOYmZlBuVyOquTDzF8OwzDlzXZdt+vfg0wcyUK1gZExhiAIuoTblECEy35ummaU983h54Gq4AuP4zh466238M53vpOyxpcQJMQJgiCIZYPneZiamsLU1GBmxDWbTZw4cQKnTp3CmjVrsGbNGliWFWVg82g+/v/j/8l+Lvr9Yu8+c388f17cnpIl/k3TjMb
2022-04-04 15:09:40 +02:00
"text/plain": [
2022-04-13 15:08:29 +02:00
"<Figure size 1080x1080 with 1 Axes>"
2022-04-04 15:09:40 +02:00
]
},
2022-04-14 15:43:51 +02:00
"metadata": {
"needs_background": "light"
},
2022-04-04 15:09:40 +02:00
"output_type": "display_data"
}
],
"source": [
2022-04-13 15:08:29 +02:00
"fig, ax = plt.subplots(figsize = (15,15))\n",
2022-04-04 15:09:40 +02:00
"nl_map.to_crs(epsg=4326).plot(ax=ax, color='lightgrey')\n",
"df_geojson_clean.plot(ax=ax)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Nu we een mooie kaart hebben van nederland met de stemlokalen erop, kunnen we gaan kijken naar hoe dit verhoud met de bevolkingsdichtheid als eerste voorbeeld. De kaart is opgehaald van het CBS, eerst gaan we kijken hoe de kaart er op zichzelf met dezelfde projectie uitziet."
]
},
{
"cell_type": "code",
2022-04-20 13:03:38 +02:00
"execution_count": 24,
2022-04-04 15:09:40 +02:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<AxesSubplot:>"
]
},
2022-04-20 13:03:38 +02:00
"execution_count": 24,
2022-04-04 15:09:40 +02:00
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
2022-04-14 15:43:51 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAOQAAAD4CAYAAAD8Q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auZwnxEx6q45oVk3iHEsmvhnoRBhsQEyo6hRRFgx+8bOPc+3FO3nz1eu58dIL2Lj2zLJ4Zgn5Koyn9xziN+96hgMLlRs2ruX779hEUaErp76ke+DIAj//yYfZkigsRbCh5iEM2h+qASrUvse7Ls5ynU5XgpRMvMgLywqIKFVAXRO0cSRPnt4SycGqMSmT/HrxOWYVE3CzoOhNshgbuCTqClG9yQdES/nWDovh1agYKkIvzqM7DvDQswdYMREuW7eSGzeuYfu+Y7znNRu5ddPaU/6ZLo5ZQr6K4uCxno/c/Qx3PbWXI8cW0FLYdXCBe7fsoajy/W+4ktdvvvBlf/1Hdhzgn33yIeaz2rgkU6eU6BRVEDegJFJpTObmoiAKDFZxM4oo5tE0GlGNVAWXqI4xPIxq6llNA3FVtAExaoBGG5tnUpE4SxYKjmFDsHH6fmBu2TIkE7OhvHGmjtpuCe6Kw6SU8QHhtWLmoMpCFZ7edZindh3CBd5104ZT+XUdN2YJ+SqJh7Yf4Bc/9yiHjvV0Wrhp0zre+5pLWb96Gf/hD5/ih954Ba+5/OU/zQ/ND/zbP3ySY31sX7gHaqqQZ0MgmTEuyZEx8C7qm2b76l3ccupxhpNMyqEfmIhiMkQyFkVMEM3Kicbnu1DNECnZGgtqjmuMQzoC8AFFVTGLc2a1IccnAiVaVcm21iSuD3NcDbxEoqugJtA5Yk4dDBehK4V1Kybcevm6U/iNHT9
2022-04-04 15:09:40 +02:00
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
2022-04-14 15:43:51 +02:00
"metadata": {
"needs_background": "light"
},
2022-04-04 15:09:40 +02:00
"output_type": "display_data"
}
],
"source": [
2022-04-12 16:39:06 +02:00
"nl_map_cbs = gpd.read_file(r'../data/shape/Netherlands_shapefile/CBS_vk500_2020_v1.shp')\n",
"nl_map_cbs.to_crs(epsg=4326).plot()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2022-04-14 15:43:51 +02:00
"Het verwerken van de 100m bij 100m vierkanten kaar duurde heel lang (langer dan een half uur) op de laptop, en is dus niet ideaal tenzij we dit niveau van detail écht nodig hebben. Er is namelijk nog een andere kaart met dezelfde gegevens beschikbaar, maar met een grid van 500 bij 500 meter in plaats van 100 bij 100. Laten we dus kijken hoe vaak een stemlokaal dichterbij dan 100 meter van de dichtstbijzijnde andere is. De makkelijkste manier om dat te doen zonder alle punten met alle andere te vergelijken (heel veel moeite), is een extra dataframe maken als een kopie, alle indexen 1 opschuiven (want alle stemlokalen zijn al in een volgorde van clustering), en dan de laagste afstand bekijken."
2022-04-04 15:09:40 +02:00
]
},
{
"cell_type": "code",
2022-04-20 13:03:38 +02:00
"execution_count": 25,
2022-04-04 15:09:40 +02:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
2022-04-12 16:39:06 +02:00
"11165 0.002608\n",
"1021 0.004853\n",
"3196 0.004875\n",
"1923 2.693202\n",
"3757 3.609362\n",
" ... \n",
2022-04-20 13:03:38 +02:00
"7436 256415.644309\n",
"9711 259842.874932\n",
2022-04-12 16:39:06 +02:00
"4392 266925.200994\n",
"9297 271954.076837\n",
"0 NaN\n",
2022-04-20 13:03:38 +02:00
"Name: distance, Length: 11572, dtype: float64\n"
2022-04-12 16:39:06 +02:00
]
}
],
"source": [
"df_shifted = df_geojson_clean.to_crs('EPSG:28992')\n",
"\n",
"df_shifted['geometry (shifted)'] = df_shifted['geometry'].shift(periods=1)\n",
"df_shifted['distance'] = df_shifted['geometry'].distance(df_shifted['geometry (shifted)'])\n",
"df_shifted.sort_values(['distance'], inplace=True, ascending=True)\n",
"zero_mask_booth = df_shifted['distance'] == 0.000000\n",
"df_shifted = df_shifted[~zero_mask_booth]\n",
"print(df_shifted['distance'])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We kunnen dus vaststellen dat afstanden van onder de 500 meter waarschijnlijk zeldzaam zijn, en we verder kunnen gaan met de 500 meter bij 500 meter kaart. Laten we nu dus een projectie proberen te maken met de bevolkingsdichtheid erop om het te vergelijken met de stemlokalen en hun posities en clustering."
]
},
{
"cell_type": "code",
2022-04-20 13:03:38 +02:00
"execution_count": 26,
2022-04-12 16:39:06 +02:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"['c28992r500', 'INWONER', 'MAN', 'VROUW', 'INW_014', 'INW_1524', 'INW_2544', 'INW_4564', 'INW_65PL', 'P_NL_ACHTG', 'P_WE_MIG_A', 'P_NW_MIG_A', 'AANTAL_HH', 'TOTHH_EENP', 'TOTHH_MPZK', 'HH_EENOUD', 'HH_TWEEOUD', 'GEM_HH_GR', 'WONING', 'WONVOOR45', 'WON_4564', 'WON_6574', 'WON_7584', 'WON_8594', 'WON_9504', 'WON_0514', 'WON_1524', 'WON_MRGEZ', 'P_KOOPWON', 'P_HUURWON', 'WON_HCORP', 'WON_NBEW', 'WOZWONING', 'UITKMINAOW', 'OAD', 'STED', 'geometry']\n"
2022-04-04 15:09:40 +02:00
]
2022-04-12 16:39:06 +02:00
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>c28992r500</th>\n",
" <th>INWONER</th>\n",
" <th>geometry</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
2022-04-14 15:43:51 +02:00
" <th>0</th>\n",
" <td>E2260N6190</td>\n",
" <td>-99997</td>\n",
" <td>POLYGON ((226000.000 619000.000, 226000.000 61...</td>\n",
2022-04-12 16:39:06 +02:00
" </tr>\n",
" <tr>\n",
2022-04-14 15:43:51 +02:00
" <th>1</th>\n",
" <td>E2265N6190</td>\n",
" <td>-99997</td>\n",
" <td>POLYGON ((226500.000 619500.000, 227000.000 61...</td>\n",
2022-04-12 16:39:06 +02:00
" </tr>\n",
" <tr>\n",
2022-04-14 15:43:51 +02:00
" <th>2</th>\n",
" <td>E2270N6190</td>\n",
" <td>-99997</td>\n",
" <td>POLYGON ((227000.000 619500.000, 227500.000 61...</td>\n",
2022-04-12 16:39:06 +02:00
" </tr>\n",
" <tr>\n",
2022-04-14 15:43:51 +02:00
" <th>3</th>\n",
" <td>E2275N6190</td>\n",
" <td>-99997</td>\n",
" <td>POLYGON ((227500.000 619500.000, 228000.000 61...</td>\n",
2022-04-12 16:39:06 +02:00
" </tr>\n",
" <tr>\n",
2022-04-14 15:43:51 +02:00
" <th>4</th>\n",
" <td>E2280N6190</td>\n",
" <td>-99997</td>\n",
" <td>POLYGON ((228000.000 619500.000, 228500.000 61...</td>\n",
2022-04-12 16:39:06 +02:00
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
2022-04-14 15:43:51 +02:00
" <th>151103</th>\n",
" <td>E1995N3070</td>\n",
" <td>-99997</td>\n",
" <td>POLYGON ((199500.000 307500.000, 200000.000 30...</td>\n",
2022-04-12 16:39:06 +02:00
" </tr>\n",
" <tr>\n",
2022-04-14 15:43:51 +02:00
" <th>151104</th>\n",
" <td>E1905N3065</td>\n",
" <td>-99997</td>\n",
" <td>POLYGON ((190500.000 307000.000, 191000.000 30...</td>\n",
2022-04-12 16:39:06 +02:00
" </tr>\n",
" <tr>\n",
2022-04-14 15:43:51 +02:00
" <th>151105</th>\n",
" <td>E1910N3065</td>\n",
" <td>-99997</td>\n",
" <td>POLYGON ((191000.000 307000.000, 191500.000 30...</td>\n",
2022-04-12 16:39:06 +02:00
" </tr>\n",
" <tr>\n",
" <th>151106</th>\n",
" <td>E1920N3065</td>\n",
" <td>20</td>\n",
" <td>POLYGON ((192000.000 307000.000, 192500.000 30...</td>\n",
" </tr>\n",
2022-04-14 15:43:51 +02:00
" <tr>\n",
" <th>151107</th>\n",
" <td>E1925N3065</td>\n",
" <td>-99997</td>\n",
" <td>POLYGON ((192500.000 307000.000, 193000.000 30...</td>\n",
" </tr>\n",
2022-04-12 16:39:06 +02:00
" </tbody>\n",
"</table>\n",
2022-04-14 15:43:51 +02:00
"<p>151108 rows × 3 columns</p>\n",
2022-04-12 16:39:06 +02:00
"</div>"
],
"text/plain": [
" c28992r500 INWONER geometry\n",
2022-04-14 15:43:51 +02:00
"0 E2260N6190 -99997 POLYGON ((226000.000 619000.000, 226000.000 61...\n",
"1 E2265N6190 -99997 POLYGON ((226500.000 619500.000, 227000.000 61...\n",
"2 E2270N6190 -99997 POLYGON ((227000.000 619500.000, 227500.000 61...\n",
"3 E2275N6190 -99997 POLYGON ((227500.000 619500.000, 228000.000 61...\n",
"4 E2280N6190 -99997 POLYGON ((228000.000 619500.000, 228500.000 61...\n",
2022-04-12 16:39:06 +02:00
"... ... ... ...\n",
2022-04-14 15:43:51 +02:00
"151103 E1995N3070 -99997 POLYGON ((199500.000 307500.000, 200000.000 30...\n",
"151104 E1905N3065 -99997 POLYGON ((190500.000 307000.000, 191000.000 30...\n",
"151105 E1910N3065 -99997 POLYGON ((191000.000 307000.000, 191500.000 30...\n",
2022-04-12 16:39:06 +02:00
"151106 E1920N3065 20 POLYGON ((192000.000 307000.000, 192500.000 30...\n",
2022-04-14 15:43:51 +02:00
"151107 E1925N3065 -99997 POLYGON ((192500.000 307000.000, 193000.000 30...\n",
2022-04-12 16:39:06 +02:00
"\n",
2022-04-14 15:43:51 +02:00
"[151108 rows x 3 columns]"
2022-04-12 16:39:06 +02:00
]
},
2022-04-20 13:03:38 +02:00
"execution_count": 26,
2022-04-12 16:39:06 +02:00
"metadata": {},
"output_type": "execute_result"
2022-04-04 15:09:40 +02:00
}
],
"source": [
2022-04-12 16:39:06 +02:00
"print(list(nl_map_cbs))\n",
"nl_map_dst = nl_map_cbs.drop(columns=['MAN', 'VROUW', 'INW_014', 'INW_1524', 'INW_2544', 'INW_4564', 'INW_65PL', 'P_NL_ACHTG', 'P_WE_MIG_A', 'P_NW_MIG_A', 'AANTAL_HH', 'TOTHH_EENP', 'TOTHH_MPZK', 'HH_EENOUD', 'HH_TWEEOUD', 'GEM_HH_GR', 'WONING', 'WONVOOR45', 'WON_4564', 'WON_6574', 'WON_7584', 'WON_8594', 'WON_9504', 'WON_0514', 'WON_1524', 'WON_MRGEZ', 'P_KOOPWON', 'P_HUURWON', 'WON_HCORP', 'WON_NBEW', 'WOZWONING', 'UITKMINAOW', 'OAD', 'STED'])\n",
"\n",
2022-04-14 15:43:51 +02:00
"nl_map_dst"
2022-04-12 16:39:06 +02:00
]
},
2022-04-13 15:08:29 +02:00
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We kunnen zien dat er gemeente zijn die geen stemlokalen hebben, dit klopt. [In de verkiezingen van 2022 hebben 12 gemeentes niet meegedaan](https://nl.wikipedia.org/wiki/Nederlandse_gemeenteraadsverkiezingen_2022). Er zijn dus in totaal 333 gemeentes met stemlokalen. We willen de bevolkingsdichtheiddata van de gemeentes die niet meededen dus weggooien, hiervoor moeten we eerst kijken welke alleen binnen de gemeentes vallen die we niet willen houden."
]
},
2022-04-12 16:39:06 +02:00
{
"cell_type": "code",
2022-04-20 13:03:38 +02:00
"execution_count": 27,
2022-04-12 16:39:06 +02:00
"metadata": {},
"outputs": [
{
2022-04-13 15:08:29 +02:00
"name": "stdout",
"output_type": "stream",
"text": [
"0 Gemeenteraad Aa en Hunze 2022\n",
"1 Gemeenteraad Aa en Hunze 2022\n",
"2 Gemeenteraad Aa en Hunze 2022\n",
"3 Gemeenteraad Aa en Hunze 2022\n",
"4 Gemeenteraad Aa en Hunze 2022\n",
" ... \n",
"12591 Gemeenteraad 's-Hertogenbosch 2022\n",
"12592 Gemeenteraad 's-Hertogenbosch 2022\n",
"12593 Gemeenteraad 's-Hertogenbosch 2022\n",
"12594 Gemeenteraad 's-Hertogenbosch 2022\n",
"12595 Gemeenteraad 's-Hertogenbosch 2022\n",
"Name: electionName, Length: 12596, dtype: object\n",
"0 Aa en Hunze\n",
"27 Aalsmeer\n",
"46 Aalten\n",
"74 Achtkarspelen\n",
"95 Alblasserdam\n",
" ... \n",
"11976 Zwartewaterland\n",
"11997 Zwijndrecht\n",
"12031 Zwolle\n",
"12122 's-Gravenhage\n",
"12495 's-Hertogenbosch\n",
"Name: electionName, Length: 333, dtype: object\n"
2022-04-12 16:39:06 +02:00
]
}
],
2022-03-29 17:09:52 +02:00
"source": [
2022-04-13 15:08:29 +02:00
"print(df_geojson['electionName'])\n",
"\n",
"#get all municipalities that are in the election\n",
"gemeentes = df_geojson['electionName'].str.slice(13, -5).drop_duplicates()\n",
"print(gemeentes)"
2022-03-30 15:43:08 +02:00
]
},
{
"cell_type": "code",
2022-04-20 13:03:38 +02:00
"execution_count": 28,
2022-03-30 15:43:08 +02:00
"metadata": {},
2022-04-13 15:08:29 +02:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Shape of clean: (333, 38)\n",
"Shape of election: (330, 38)\n"
]
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>GM_CODE</th>\n",
" <th>GM_NAAM</th>\n",
" <th>H2O</th>\n",
" <th>OAD</th>\n",
" <th>STED</th>\n",
" <th>BEV_DICHTH</th>\n",
" <th>AANT_INW</th>\n",
" <th>AANT_MAN</th>\n",
" <th>AANT_VROUW</th>\n",
" <th>P_00_14_JR</th>\n",
" <th>...</th>\n",
" <th>P_TURKIJE</th>\n",
" <th>P_OVER_NW</th>\n",
" <th>OPP_TOT</th>\n",
" <th>OPP_LAND</th>\n",
" <th>OPP_WATER</th>\n",
" <th>JRSTATCODE</th>\n",
" <th>JAAR</th>\n",
" <th>Shape_Leng</th>\n",
" <th>Shape_Area</th>\n",
" <th>geometry</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>113</th>\n",
" <td>GM0164</td>\n",
" <td>Hengelo</td>\n",
" <td>NEE</td>\n",
" <td>1845</td>\n",
" <td>2</td>\n",
" <td>1332</td>\n",
" <td>81049</td>\n",
" <td>40776</td>\n",
" <td>40273</td>\n",
" <td>15</td>\n",
" <td>...</td>\n",
" <td>6</td>\n",
" <td>7</td>\n",
" <td>6183</td>\n",
" <td>6084</td>\n",
" <td>99</td>\n",
" <td>2021GM0164</td>\n",
" <td>2021</td>\n",
" <td>47510.255914</td>\n",
" <td>6.183056e+07</td>\n",
" <td>POLYGON ((251978.591 481220.258, 251979.382 48...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>191</th>\n",
" <td>GM0373</td>\n",
" <td>Bergen (NH.)</td>\n",
" <td>NEE</td>\n",
" <td>819</td>\n",
" <td>4</td>\n",
" <td>300</td>\n",
" <td>29715</td>\n",
" <td>14317</td>\n",
" <td>15398</td>\n",
" <td>12</td>\n",
" <td>...</td>\n",
" <td>0</td>\n",
" <td>3</td>\n",
" <td>12023</td>\n",
" <td>9896</td>\n",
" <td>2127</td>\n",
" <td>2021GM0373</td>\n",
" <td>2021</td>\n",
" <td>57488.474563</td>\n",
" <td>9.987418e+07</td>\n",
" <td>POLYGON ((105976.650 529056.951, 106002.347 52...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>328</th>\n",
" <td>GM0893</td>\n",
" <td>Bergen (L.)</td>\n",
" <td>NEE</td>\n",
" <td>318</td>\n",
" <td>5</td>\n",
" <td>127</td>\n",
" <td>13108</td>\n",
" <td>6568</td>\n",
" <td>6540</td>\n",
" <td>13</td>\n",
" <td>...</td>\n",
" <td>0</td>\n",
" <td>3</td>\n",
" <td>10850</td>\n",
" <td>10324</td>\n",
" <td>525</td>\n",
" <td>2021GM0893</td>\n",
" <td>2021</td>\n",
" <td>61497.563571</td>\n",
" <td>1.084951e+08</td>\n",
" <td>POLYGON ((199768.270 409749.960, 199758.060 40...</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>3 rows × 38 columns</p>\n",
"</div>"
],
"text/plain": [
" GM_CODE GM_NAAM H2O OAD STED BEV_DICHTH AANT_INW AANT_MAN \\\n",
"113 GM0164 Hengelo NEE 1845 2 1332 81049 40776 \n",
"191 GM0373 Bergen (NH.) NEE 819 4 300 29715 14317 \n",
"328 GM0893 Bergen (L.) NEE 318 5 127 13108 6568 \n",
"\n",
" AANT_VROUW P_00_14_JR ... P_TURKIJE P_OVER_NW OPP_TOT OPP_LAND \\\n",
"113 40273 15 ... 6 7 6183 6084 \n",
"191 15398 12 ... 0 3 12023 9896 \n",
"328 6540 13 ... 0 3 10850 10324 \n",
"\n",
" OPP_WATER JRSTATCODE JAAR Shape_Leng Shape_Area \\\n",
"113 99 2021GM0164 2021 47510.255914 6.183056e+07 \n",
"191 2127 2021GM0373 2021 57488.474563 9.987418e+07 \n",
"328 525 2021GM0893 2021 61497.563571 1.084951e+08 \n",
"\n",
" geometry \n",
"113 POLYGON ((251978.591 481220.258, 251979.382 48... \n",
"191 POLYGON ((105976.650 529056.951, 106002.347 52... \n",
"328 POLYGON ((199768.270 409749.960, 199758.060 40... \n",
"\n",
"[3 rows x 38 columns]"
]
},
2022-04-20 13:03:38 +02:00
"execution_count": 28,
2022-04-13 15:08:29 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#First let's remove the municipalities that don't have an Election from the municipality map\n",
"remove_lst = [\"Boxtel\", \"Eemsdelta\", \"Oisterwijk\", \"Vught\", \"Heerhugowaard\", \"Langedijk\", \"Boxmeer\", \"Cuijk\", \"Sint Anthonis\", \"Mill en Sint Hubert\", \"Grave\", \"Landerd\", \"Uden\", \"Brielle\", \"Hellevoetsluis\", \"Westvoorne\", \"Purmerend\", \"Beemster\", \"Weesp\"]\n",
"\n",
2022-04-20 13:03:38 +02:00
"\n",
2022-04-13 15:08:29 +02:00
"nl_map_clean = nl_map[~nl_map[\"GM_NAAM\"].isin(remove_lst)]\n",
"nl_map_clean = nl_map_clean.query(\"H2O != 'JA'\")\n",
"nl_map_clean = nl_map_clean.query(\"GM_NAAM != 'Buitenland'\")\n",
"\n",
2022-04-20 13:03:38 +02:00
"\n",
2022-04-13 15:08:29 +02:00
"nl_map_election = nl_map[nl_map[\"GM_NAAM\"].isin(gemeentes)]\n",
"nl_map_election = nl_map_election.query(\"H2O != 'JA'\")\n",
"\n",
"print(\"Shape of clean: {}\".format(nl_map_clean.shape))\n",
"print(\"Shape of election: {}\".format(nl_map_election.shape))\n",
"\n",
"diff = pd.concat([nl_map_election, nl_map_clean]).drop_duplicates(keep=False)\n",
"diff"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2022-04-20 13:03:38 +02:00
"Het is een andere vorm omdat deze drie gemeentes een andere format hadden voor de naam van hun verkiezingen, en dus niet op dezelfde manier gefilterd konden worden, ze staan wel in de lijst, dit is dus correct, we gebruiken de clean dataframe.\n",
2022-04-13 15:08:29 +02:00
"Nu we dezelfde lijst hebben van gemeentes die in de verkiezingen meededen kunnen we verder."
]
},
{
"cell_type": "code",
2022-04-20 13:03:38 +02:00
"execution_count": 29,
2022-04-13 15:08:29 +02:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<AxesSubplot:>"
]
},
2022-04-20 13:03:38 +02:00
"execution_count": 29,
2022-04-13 15:08:29 +02:00
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
2022-04-20 13:03:38 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAt4AAANOCAYAAAAmhQuoAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAm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BD583YV45+uHAVTTS8hK0jyMMZRKJeH/KpUKDMNAPB5He3s72trapLYh/lyeKnOuzPJsNugbQxAEQWx6LMvCqVOnkMlkpM+xbRvLy8tYXl6u+5umaYhGo87/uIDh4oULay6muShSaULXCHyQwL3TxWLR9/m8or1z5846waWyqLGrq6umcs0YQzwex81v6MGv79/VwB4QIhhjmJubQzabBWMMxWIxcDbCsiyUSiUsLS1B0zS0tbWhp6cHqVTKec7y8jJOnjwJ0zTR3d2NVCqFRCIB27ZpUesGg4Q3QRAEsakplUp49dVXm2r4wkWQW+DKMqxVs629ePOtI5EIent7EYvFajKwbdtGPB5HNBoFUBVeQdXLdDqNCy+8sOEqZzwer9vWvr6+ht6LWMG2bRSLRSwvLyOTyTiLWBuFMYalpSUsLS2ho6MDXV1dKJfLOH36NIDqzEU2m0W5XEYymUQ+n6euoBsMEt4EQRDEpoUxhlOnTqFUKjUsiEXIMqxfmirgqeM55Wxr77bqug7bttHX1+d4qoPQdR2JRCLweVTZ3BgwxlAoFDAzM4OlpaVVmxVZXFzE4uKi8+9UKoVYLIZMJoNSqQTbtnHixAlEIhF0d3ejq6uLrpENAAlvgiAIYtPC00v8mr28NFXA48eysF36py9AmMsyrL3vwx8
2022-04-13 15:08:29 +02:00
"text/plain": [
"<Figure size 1080x1080 with 1 Axes>"
]
},
2022-04-14 15:43:51 +02:00
"metadata": {
"needs_background": "light"
},
2022-04-13 15:08:29 +02:00
"output_type": "display_data"
}
],
"source": [
"fig, ax = plt.subplots(figsize = (15,15))\n",
"nl_map_clean.to_crs(epsg=4326).plot(ax=ax, color='lightgrey')\n",
"df_geojson_clean.plot(ax=ax)"
]
},
2022-04-14 15:43:51 +02:00
{
"cell_type": "code",
2022-04-20 13:03:38 +02:00
"execution_count": 30,
2022-04-14 15:43:51 +02:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<AxesSubplot:>"
]
},
2022-04-20 13:03:38 +02:00
"execution_count": 30,
2022-04-14 15:43:51 +02:00
"metadata": {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bHRKqSbEiJV+AY2BgHc7/X/ZvI+sWBRFEDW39dhJCEBTL1rKGyRax1QsRU2a7F+yzRNDtJvDrmMT/JNPPMgNm5dxy6ZlfGf3UUYnapYv7OODt248J9/LubCuM76CbPexcf7i/r08tn+MgNLf32LtogX86T272bRygL/3livO+jP+6Fs7+fLTRwgISEBF3XGAEIgo2Sbt1t2sFCF4/ShorkkI4gN4BasXq4gEhRw85aRJOUXNKTMBcYdUMhKCRdHy8RLJ2EWtomjKKFC3a47kxJcfO8xXnjhs0VSgipHB/khK8NDeE1y2YiFP7B9m+5rF/PTtW876u3qp1nXGV4jd+ch+vvDIISY7NWuX9PHuV63ntVtX8PDeE9x21WredtXZ10xffeowf/XUQUQiWd0hEHOo5CmpGjY1Z4tUMcQyRPEIFj16Wvrp5SN1XVs7NOKdU0E0mAMGT3AdTUMGsiAxWG2q2aMpVCXS5kDw1De0LMVNuUaTvS4idOqav3hgH8k/b+fRcVQTY52arc8M8Ibtz9tNc16t64yvAPsf39rFt3cc5VUbl/Darcu5dv0Sm9kBr9q4lFdtPHvQ9chkhz+7by/kgERBAwS1KAaglRCyjU00Y1C6bH/JKgTsqSKAClnEol8UqEE0E2L0sYQnojkhJFShoxCCICEYoiZauppFQL1hFKxLGxSyN3SyJkKsiD76CMEeSwqafcQS7Pg6qsQYmZjJ7Bqa4A3bV3Jios1XnzxET1Vx+xUr6I2RvnMI9ZtrXWe8iG2mTvy3b+7i/t3HWdQX+cCrN7Fs4MUB2QCff/QQmcw7r1v3os/94uOH+dSD+5jpZJt
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"nl_map_dst['savedindex'] = nl_map_dst.index #Save the index values as a new column\n",
"\n",
"intersecting = nl_map_clean.sjoin(nl_map_dst, how='inner')['savedindex'] #Find the polygons that intersect. Keep savedindex as a series\n",
"\n",
"nl_map_dst = nl_map_dst.loc[nl_map_dst.savedindex.isin(intersecting)] #Filter away these, \"savedindex is in intersecting\"\n",
"\n",
"nl_map_dst.to_crs(epsg=4326).plot()\n",
"\n"
]
},
2022-04-13 15:08:29 +02:00
{
"cell_type": "code",
2022-04-20 13:03:38 +02:00
"execution_count": 31,
2022-04-13 15:08:29 +02:00
"metadata": {},
2022-04-14 15:43:51 +02:00
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/lillian/anaconda3/lib/python3.9/site-packages/geopandas/geodataframe.py:1351: SettingWithCopyWarning: \n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
" super().__setitem__(key, value)\n"
]
}
],
"source": [
"import folium\n",
"from folium import plugins\n",
"\n",
"#Location is Amersfoort, the central point of the continental Netherlands\n",
"map = folium.Map(location = [52.155, 5.3875], zoom_start = 9, tiles=\"cartodbdark_matter\", prefer_canvas=True)\n",
"\n",
"nl_map_dst.to_crs(epsg=4326)\n",
"#Make sure the index is a string so folium can read it correctly as a key.\n",
"nl_map_dst['c28992r500'] = nl_map_dst['c28992r500'].apply(lambda x: str(x))\n",
"\n",
"nl_map_dst_zero = nl_map_dst.copy()\n",
"\n",
"zero_mask_pop = nl_map_dst['INWONER'] == -99997\n",
"nl_map_dst = nl_map_dst[~zero_mask_pop]\n",
"zero_mask_pop2 = nl_map_dst['INWONER'] == 0\n",
"nl_map_dst = nl_map_dst[~zero_mask_pop2]\n",
"\n",
"folium.Choropleth(\n",
" geo_data = nl_map_dst,\n",
" name=\"Bevolkingsdichtheid\",\n",
" data = nl_map_dst,\n",
" columns = [\"c28992r500\", \"INWONER\"],\n",
" key_on = 'feature.properties.c28992r500',\n",
" fill_color = 'RdPu',\n",
" nan_fill_color= 'white',\n",
" fill_opacity = 0.7,\n",
" nan_fill_opacity = 0.7,\n",
" line_opacity = 0,\n",
" legend_name = 'Bevolkingsdichtheid',\n",
" smooth_factor = 1.0,\n",
" show=False\n",
").add_to(map)\n",
"map\n",
"\n",
"# Renders the map to an HTML file and displays it in an embed.\n",
"def embed_map(m):\n",
" #from IPython.display import IFrame\n",
" m.save('index.html')\n",
" #return IFrame('index.html', width='100%', height='750px')"
]
},
{
"cell_type": "code",
2022-04-20 13:03:38 +02:00
"execution_count": 32,
2022-04-14 15:43:51 +02:00
"metadata": {},
"outputs": [],
"source": [
2022-04-20 13:03:38 +02:00
"gdf_wims_hmp = [[point.xy[1][0], point.xy[0][0]] for point in gdf_wims.geometry]\n",
2022-04-14 15:43:51 +02:00
"\n",
2022-04-20 13:03:38 +02:00
"plugins.HeatMap(gdf_wims_hmp, name=\"Stemlokalen Heatmap\").add_to(map)\n",
2022-04-14 15:43:51 +02:00
"\n",
"folium.LayerControl().add_to(map)\n",
"\n",
"\n",
"\n",
"embed_map(map)\n",
"\n",
"\n"
]
},
{
"cell_type": "code",
2022-04-20 13:03:38 +02:00
"execution_count": 33,
2022-04-14 15:43:51 +02:00
"metadata": {},
2022-04-13 15:08:29 +02:00
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>c28992r500</th>\n",
" <th>INWONER</th>\n",
" <th>geometry</th>\n",
2022-04-14 15:43:51 +02:00
" <th>savedindex</th>\n",
2022-04-13 15:08:29 +02:00
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
2022-04-14 15:43:51 +02:00
" <th>2</th>\n",
" <td>E2270N6190</td>\n",
" <td>-99997</td>\n",
" <td>POINT (227250.000 619250.000)</td>\n",
" <td>2</td>\n",
2022-04-13 15:08:29 +02:00
" </tr>\n",
" <tr>\n",
2022-04-14 15:43:51 +02:00
" <th>3</th>\n",
" <td>E2275N6190</td>\n",
" <td>-99997</td>\n",
" <td>POINT (227750.000 619250.000)</td>\n",
" <td>3</td>\n",
2022-04-13 15:08:29 +02:00
" </tr>\n",
" <tr>\n",
2022-04-14 15:43:51 +02:00
" <th>4</th>\n",
" <td>E2280N6190</td>\n",
" <td>-99997</td>\n",
" <td>POINT (228250.000 619250.000)</td>\n",
" <td>4</td>\n",
2022-04-13 15:08:29 +02:00
" </tr>\n",
" <tr>\n",
2022-04-14 15:43:51 +02:00
" <th>7</th>\n",
" <td>E2265N6185</td>\n",
" <td>-99997</td>\n",
" <td>POINT (226750.000 618750.000)</td>\n",
" <td>7</td>\n",
2022-04-13 15:08:29 +02:00
" </tr>\n",
" <tr>\n",
2022-04-14 15:43:51 +02:00
" <th>8</th>\n",
" <td>E2270N6185</td>\n",
" <td>-99997</td>\n",
" <td>POINT (227250.000 618750.000)</td>\n",
" <td>8</td>\n",
2022-04-13 15:08:29 +02:00
" </tr>\n",
2022-04-14 15:43:51 +02:00
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>151102</th>\n",
" <td>E1990N3070</td>\n",
" <td>-99997</td>\n",
" <td>POINT (199250.000 307250.000)</td>\n",
" <td>151102</td>\n",
" </tr>\n",
" <tr>\n",
" <th>151103</th>\n",
" <td>E1995N3070</td>\n",
" <td>-99997</td>\n",
" <td>POINT (199750.000 307250.000)</td>\n",
" <td>151103</td>\n",
" </tr>\n",
" <tr>\n",
" <th>151105</th>\n",
" <td>E1910N3065</td>\n",
" <td>-99997</td>\n",
" <td>POINT (191250.000 306750.000)</td>\n",
" <td>151105</td>\n",
" </tr>\n",
" <tr>\n",
" <th>151106</th>\n",
" <td>E1920N3065</td>\n",
" <td>20</td>\n",
" <td>POINT (192250.000 306750.000)</td>\n",
" <td>151106</td>\n",
" </tr>\n",
" <tr>\n",
" <th>151107</th>\n",
" <td>E1925N3065</td>\n",
" <td>-99997</td>\n",
" <td>POINT (192750.000 306750.000)</td>\n",
" <td>151107</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>140002 rows × 4 columns</p>\n",
"</div>"
],
"text/plain": [
" c28992r500 INWONER geometry savedindex\n",
"2 E2270N6190 -99997 POINT (227250.000 619250.000) 2\n",
"3 E2275N6190 -99997 POINT (227750.000 619250.000) 3\n",
"4 E2280N6190 -99997 POINT (228250.000 619250.000) 4\n",
"7 E2265N6185 -99997 POINT (226750.000 618750.000) 7\n",
"8 E2270N6185 -99997 POINT (227250.000 618750.000) 8\n",
"... ... ... ... ...\n",
"151102 E1990N3070 -99997 POINT (199250.000 307250.000) 151102\n",
"151103 E1995N3070 -99997 POINT (199750.000 307250.000) 151103\n",
"151105 E1910N3065 -99997 POINT (191250.000 306750.000) 151105\n",
"151106 E1920N3065 20 POINT (192250.000 306750.000) 151106\n",
"151107 E1925N3065 -99997 POINT (192750.000 306750.000) 151107\n",
"\n",
"[140002 rows x 4 columns]"
]
},
2022-04-20 13:03:38 +02:00
"execution_count": 33,
2022-04-14 15:43:51 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"nl_map_dst_points = nl_map_dst.copy()\n",
"nl_map_dst_points['geometry'] = nl_map_dst_points['geometry'].centroid\n",
"\n",
"nl_map_dst_zero_points = nl_map_dst_zero.copy()\n",
"nl_map_dst_zero_points['geometry'] = nl_map_dst_zero_points['geometry'].centroid\n",
"\n",
"nl_map_dst_zero_points"
]
},
{
"cell_type": "code",
2022-04-20 13:03:38 +02:00
"execution_count": 34,
2022-04-14 15:43:51 +02:00
"metadata": {
"scrolled": false
},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>c28992r500</th>\n",
" <th>INWONER</th>\n",
" <th>geometry</th>\n",
" <th>savedindex</th>\n",
2022-04-20 13:03:38 +02:00
" <th>_id</th>\n",
" <th>Gemeente</th>\n",
" <th>CBS gemeentecode</th>\n",
" <th>Nummer stembureau</th>\n",
" <th>Naam stembureau</th>\n",
" <th>Gebruiksdoel van het gebouw</th>\n",
2022-04-14 15:43:51 +02:00
" <th>...</th>\n",
2022-04-20 13:03:38 +02:00
" <th>Hoofdstembureau</th>\n",
" <th>Tellocatie</th>\n",
" <th>Contactgegevens gemeente</th>\n",
" <th>Verkiezingswebsite gemeente</th>\n",
" <th>Verkiezingen</th>\n",
" <th>ID</th>\n",
" <th>UUID</th>\n",
" <th>Unnamed: 39</th>\n",
" <th>Unnamed: 40</th>\n",
2022-04-14 15:43:51 +02:00
" <th>dist</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>E2050N6110</td>\n",
" <td>5</td>\n",
" <td>POINT (205250.000 611250.000)</td>\n",
" <td>267</td>\n",
2022-04-20 13:03:38 +02:00
" <td>30871</td>\n",
" <td>Schiermonnikoog</td>\n",
" <td>GM0088</td>\n",
2022-04-14 15:43:51 +02:00
" <td>1</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Gemeentehuis (Raadzaal)</td>\n",
" <td>kantoorfunctie</td>\n",
2022-04-14 15:43:51 +02:00
" <td>...</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Schiermonnikoog</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>postbus20@schiermonnikoog.nl, 0519-535050</td>\n",
" <td>https://www.schiermonnikoog.nl/in-de-gemeente/...</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>NLODSGM0088stembureaus20220316009</td>\n",
" <td>35abba36eca7485c89e82b2917633ae7</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>1331.950309</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>E2060N6110</td>\n",
" <td>15</td>\n",
" <td>POINT (206250.000 611250.000)</td>\n",
" <td>269</td>\n",
2022-04-20 13:03:38 +02:00
" <td>30871</td>\n",
" <td>Schiermonnikoog</td>\n",
" <td>GM0088</td>\n",
2022-04-14 15:43:51 +02:00
" <td>1</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Gemeentehuis (Raadzaal)</td>\n",
" <td>kantoorfunctie</td>\n",
2022-04-14 15:43:51 +02:00
" <td>...</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Schiermonnikoog</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>postbus20@schiermonnikoog.nl, 0519-535050</td>\n",
" <td>https://www.schiermonnikoog.nl/in-de-gemeente/...</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>NLODSGM0088stembureaus20220316009</td>\n",
" <td>35abba36eca7485c89e82b2917633ae7</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>688.536284</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>E2055N6105</td>\n",
" <td>20</td>\n",
" <td>POINT (205750.000 610750.000)</td>\n",
" <td>292</td>\n",
2022-04-20 13:03:38 +02:00
" <td>30871</td>\n",
" <td>Schiermonnikoog</td>\n",
" <td>GM0088</td>\n",
2022-04-14 15:43:51 +02:00
" <td>1</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Gemeentehuis (Raadzaal)</td>\n",
" <td>kantoorfunctie</td>\n",
2022-04-14 15:43:51 +02:00
" <td>...</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Schiermonnikoog</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>postbus20@schiermonnikoog.nl, 0519-535050</td>\n",
" <td>https://www.schiermonnikoog.nl/in-de-gemeente/...</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>NLODSGM0088stembureaus20220316009</td>\n",
" <td>35abba36eca7485c89e82b2917633ae7</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>672.375861</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>E2060N6105</td>\n",
" <td>185</td>\n",
" <td>POINT (206250.000 610750.000)</td>\n",
" <td>293</td>\n",
2022-04-20 13:03:38 +02:00
" <td>30871</td>\n",
" <td>Schiermonnikoog</td>\n",
" <td>GM0088</td>\n",
2022-04-14 15:43:51 +02:00
" <td>1</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Gemeentehuis (Raadzaal)</td>\n",
" <td>kantoorfunctie</td>\n",
2022-04-14 15:43:51 +02:00
" <td>...</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Schiermonnikoog</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>postbus20@schiermonnikoog.nl, 0519-535050</td>\n",
" <td>https://www.schiermonnikoog.nl/in-de-gemeente/...</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>NLODSGM0088stembureaus20220316009</td>\n",
" <td>35abba36eca7485c89e82b2917633ae7</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>228.220493</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>E2065N6105</td>\n",
" <td>340</td>\n",
" <td>POINT (206750.000 610750.000)</td>\n",
" <td>294</td>\n",
2022-04-20 13:03:38 +02:00
" <td>30871</td>\n",
" <td>Schiermonnikoog</td>\n",
" <td>GM0088</td>\n",
2022-04-14 15:43:51 +02:00
" <td>1</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Gemeentehuis (Raadzaal)</td>\n",
" <td>kantoorfunctie</td>\n",
2022-04-14 15:43:51 +02:00
" <td>...</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Schiermonnikoog</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>postbus20@schiermonnikoog.nl, 0519-535050</td>\n",
" <td>https://www.schiermonnikoog.nl/in-de-gemeente/...</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>NLODSGM0088stembureaus20220316009</td>\n",
" <td>35abba36eca7485c89e82b2917633ae7</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>389.974214</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
2022-04-20 13:03:38 +02:00
"<p>5 rows × 46 columns</p>\n",
2022-04-14 15:43:51 +02:00
"</div>"
],
"text/plain": [
2022-04-20 13:03:38 +02:00
" c28992r500 INWONER geometry savedindex _id \\\n",
"0 E2050N6110 5 POINT (205250.000 611250.000) 267 30871 \n",
"1 E2060N6110 15 POINT (206250.000 611250.000) 269 30871 \n",
"2 E2055N6105 20 POINT (205750.000 610750.000) 292 30871 \n",
"3 E2060N6105 185 POINT (206250.000 610750.000) 293 30871 \n",
"4 E2065N6105 340 POINT (206750.000 610750.000) 294 30871 \n",
"\n",
" Gemeente CBS gemeentecode Nummer stembureau \\\n",
"0 Schiermonnikoog GM0088 1 \n",
"1 Schiermonnikoog GM0088 1 \n",
"2 Schiermonnikoog GM0088 1 \n",
"3 Schiermonnikoog GM0088 1 \n",
"4 Schiermonnikoog GM0088 1 \n",
"\n",
" Naam stembureau Gebruiksdoel van het gebouw ... Hoofdstembureau \\\n",
"0 Gemeentehuis (Raadzaal) kantoorfunctie ... Schiermonnikoog \n",
"1 Gemeentehuis (Raadzaal) kantoorfunctie ... Schiermonnikoog \n",
"2 Gemeentehuis (Raadzaal) kantoorfunctie ... Schiermonnikoog \n",
"3 Gemeentehuis (Raadzaal) kantoorfunctie ... Schiermonnikoog \n",
"4 Gemeentehuis (Raadzaal) kantoorfunctie ... Schiermonnikoog \n",
"\n",
" Tellocatie Contactgegevens gemeente \\\n",
"0 NaN postbus20@schiermonnikoog.nl, 0519-535050 \n",
"1 NaN postbus20@schiermonnikoog.nl, 0519-535050 \n",
"2 NaN postbus20@schiermonnikoog.nl, 0519-535050 \n",
"3 NaN postbus20@schiermonnikoog.nl, 0519-535050 \n",
"4 NaN postbus20@schiermonnikoog.nl, 0519-535050 \n",
"\n",
" Verkiezingswebsite gemeente Verkiezingen \\\n",
"0 https://www.schiermonnikoog.nl/in-de-gemeente/... NaN \n",
"1 https://www.schiermonnikoog.nl/in-de-gemeente/... NaN \n",
"2 https://www.schiermonnikoog.nl/in-de-gemeente/... NaN \n",
"3 https://www.schiermonnikoog.nl/in-de-gemeente/... NaN \n",
"4 https://www.schiermonnikoog.nl/in-de-gemeente/... NaN \n",
"\n",
" ID UUID \\\n",
"0 NLODSGM0088stembureaus20220316009 35abba36eca7485c89e82b2917633ae7 \n",
"1 NLODSGM0088stembureaus20220316009 35abba36eca7485c89e82b2917633ae7 \n",
"2 NLODSGM0088stembureaus20220316009 35abba36eca7485c89e82b2917633ae7 \n",
"3 NLODSGM0088stembureaus20220316009 35abba36eca7485c89e82b2917633ae7 \n",
"4 NLODSGM0088stembureaus20220316009 35abba36eca7485c89e82b2917633ae7 \n",
"\n",
" Unnamed: 39 Unnamed: 40 dist \n",
"0 NaN NaN 1331.950309 \n",
"1 NaN NaN 688.536284 \n",
"2 NaN NaN 672.375861 \n",
"3 NaN NaN 228.220493 \n",
"4 NaN NaN 389.974214 \n",
"\n",
"[5 rows x 46 columns]"
2022-04-14 15:43:51 +02:00
]
},
2022-04-20 13:03:38 +02:00
"execution_count": 34,
2022-04-14 15:43:51 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import numpy as np\n",
"\n",
"from scipy.spatial import cKDTree\n",
"from shapely.geometry import Point\n",
"#Found on https://gis.stackexchange.com/questions/222315/finding-nearest-point-in-other-geodataframe-using-geopandas\n",
"def ckdnearest(gdA, gdB):\n",
"\n",
" nA = np.array(list(gdA.geometry.apply(lambda x: (x.x, x.y))))\n",
" nB = np.array(list(gdB.geometry.apply(lambda x: (x.x, x.y))))\n",
" btree = cKDTree(nB)\n",
" dist, idx = btree.query(nA, k=1)\n",
" gdB_nearest = gdB.iloc[idx].drop(columns=\"geometry\").reset_index(drop=True)\n",
" gdf = pd.concat(\n",
" [\n",
" gdA.reset_index(drop=True),\n",
" gdB_nearest,\n",
" pd.Series(dist, name='dist')\n",
" ], \n",
" axis=1)\n",
"\n",
" return gdf\n",
"\n",
"#error bar is +- sqrt(250²*2)m ≈ +-353.553390593m\n",
"error = np.sqrt(250**2 + 250**2)\n",
2022-04-20 13:03:38 +02:00
"df_nearest = ckdnearest(nl_map_dst_points.to_crs(epsg=28992), gdf_wims.to_crs(epsg=28992))\n",
2022-04-14 15:43:51 +02:00
"df_nearest.head()\n",
"\n"
]
},
{
"cell_type": "code",
2022-04-20 13:03:38 +02:00
"execution_count": 35,
2022-04-14 15:43:51 +02:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Text(0, 0.5, 'Bevolking (Millioenen)')"
]
},
2022-04-20 13:03:38 +02:00
"execution_count": 35,
2022-04-14 15:43:51 +02:00
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
2022-04-20 13:03:38 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAwsAAALiCAYAAACWmkpEAAAAOXRFWHRTb2Z0d2FyZQBNYXRwb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QAAYEgsAAAAQ2IBAAAYEgsAAMCQWAAAAIbEAgAAMLSWsVBVR6tqa7FYzD0KAAAcWGsZC9293d3HNjY25h4FAAAOrLWMBQAAYHpiAQAAGBILAADAkFgAAACGxAIAADAkFgAAgCGxAAAADIkFAABgSCwAAABDYgEAABgSCwAAwJBYAAAAhsQCAAAwJBYAAIAhsQAAAAwdmnsAOEgOH79t7hH2hQevv2ruEQCAs8CRBQAAYEgsAAAAQ2IBAAAYEgsAAMDQWsZCVR2tqq3FYjH3KAAAcGCtZSx093Z3H9vY2Jh7FAAAOLDWMhYAAIDpiQUAAGBILAAAAENiAQAAGBILAADAkFgAAACGxAIAADAkFgAAgCGxAAAADIkFAABgSCwAAABDYgEAABgSCwAAwJBYAAAAhsQCAAAwJBYAAIAhsQAAAAyJBQAAYEgsAAAAQ2IBAAAYEgsAAMCQWAAAAIbEAgAAMHTodG+oqicl+Zwkn5bkg0nu6e7fnXowAABgXqeMhap6TpJvT/LiJL+R5OEkH5vkT1bVHyb5oSRv6O6PnotBAQCAc2uvIwv/KMlrk3xjd/fuF6rqk5N8dZKvS/KG6cYDAADmcspY6O5r93jtoSTfN8VAAADA/nDaaxaSpKq+IMnh3e/v7h+baCYAAGAfWOUC5x9P8pwkv5TkI8vlTiIWAADgAFvlyMJmkiMnX7cAAAAcbKs8Z+HuJH9i6kE
2022-04-14 15:43:51 +02:00
"text/plain": [
"<Figure size 936x936 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"df_nearest['dist'].plot(kind=\"hist\", weights=df_nearest['INWONER'], figsize=(13,13), density=False, log=True).set_ylabel('Bevolking (Millioenen)')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Het was mooier geweest als we het konden filteren op alleen stemgerechtigden en niet op de gehele populatiedichtheid, maar het CBS geeft geen data vrij die daarbij helpt. Er is een categorie voor 0-14 jaar oude mensen, maar niet alle minderjarigen of niet stemgerechtigde. Het moet dus maar met totale bevolkingsdichtheid om een idee te krijgen."
]
},
{
"cell_type": "code",
2022-04-20 13:03:38 +02:00
"execution_count": 36,
2022-04-14 15:43:51 +02:00
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>c28992r500</th>\n",
" <th>INWONER</th>\n",
" <th>geometry</th>\n",
" <th>savedindex</th>\n",
2022-04-20 13:03:38 +02:00
" <th>_id</th>\n",
" <th>Gemeente</th>\n",
" <th>CBS gemeentecode</th>\n",
" <th>Nummer stembureau</th>\n",
" <th>Naam stembureau</th>\n",
" <th>Gebruiksdoel van het gebouw</th>\n",
2022-04-14 15:43:51 +02:00
" <th>...</th>\n",
2022-04-20 13:03:38 +02:00
" <th>Hoofdstembureau</th>\n",
" <th>Tellocatie</th>\n",
" <th>Contactgegevens gemeente</th>\n",
" <th>Verkiezingswebsite gemeente</th>\n",
" <th>Verkiezingen</th>\n",
" <th>ID</th>\n",
" <th>UUID</th>\n",
" <th>Unnamed: 39</th>\n",
" <th>Unnamed: 40</th>\n",
2022-04-14 15:43:51 +02:00
" <th>dist</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>E2270N6190</td>\n",
" <td>0</td>\n",
" <td>POINT (227250.000 619250.000)</td>\n",
" <td>2</td>\n",
2022-04-20 13:03:38 +02:00
" <td>31030</td>\n",
" <td>Het Hogeland</td>\n",
" <td>GM1966</td>\n",
" <td>1</td>\n",
" <td>Dorpshuis Pieterburen</td>\n",
" <td>bijeenkomstfunctie,logiesfunctie</td>\n",
2022-04-14 15:43:51 +02:00
" <td>...</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Het Hogeland</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>verkiezingen@hethogeland.nl</td>\n",
" <td>https://hethogeland.nl/bestuur-en-organisatie/...</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>NLODSGM1966stembureaus20220316009</td>\n",
" <td>6df04b8dd4be4aa3b4a03f221ab5ad17</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>17236.920436</td>\n",
2022-04-14 15:43:51 +02:00
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>E2275N6190</td>\n",
" <td>0</td>\n",
" <td>POINT (227750.000 619250.000)</td>\n",
" <td>3</td>\n",
2022-04-20 13:03:38 +02:00
" <td>31030</td>\n",
" <td>Het Hogeland</td>\n",
" <td>GM1966</td>\n",
" <td>1</td>\n",
" <td>Dorpshuis Pieterburen</td>\n",
" <td>bijeenkomstfunctie,logiesfunctie</td>\n",
2022-04-14 15:43:51 +02:00
" <td>...</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Het Hogeland</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>verkiezingen@hethogeland.nl</td>\n",
" <td>https://hethogeland.nl/bestuur-en-organisatie/...</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>NLODSGM1966stembureaus20220316009</td>\n",
" <td>6df04b8dd4be4aa3b4a03f221ab5ad17</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>17280.014918</td>\n",
2022-04-14 15:43:51 +02:00
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>E2280N6190</td>\n",
" <td>0</td>\n",
" <td>POINT (228250.000 619250.000)</td>\n",
" <td>4</td>\n",
2022-04-20 13:03:38 +02:00
" <td>31030</td>\n",
" <td>Het Hogeland</td>\n",
" <td>GM1966</td>\n",
" <td>1</td>\n",
" <td>Dorpshuis Pieterburen</td>\n",
" <td>bijeenkomstfunctie,logiesfunctie</td>\n",
2022-04-14 15:43:51 +02:00
" <td>...</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Het Hogeland</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>verkiezingen@hethogeland.nl</td>\n",
" <td>https://hethogeland.nl/bestuur-en-organisatie/...</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>NLODSGM1966stembureaus20220316009</td>\n",
" <td>6df04b8dd4be4aa3b4a03f221ab5ad17</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>17337.427867</td>\n",
2022-04-14 15:43:51 +02:00
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>E2265N6185</td>\n",
" <td>0</td>\n",
" <td>POINT (226750.000 618750.000)</td>\n",
" <td>7</td>\n",
2022-04-20 13:03:38 +02:00
" <td>31030</td>\n",
" <td>Het Hogeland</td>\n",
" <td>GM1966</td>\n",
" <td>1</td>\n",
" <td>Dorpshuis Pieterburen</td>\n",
" <td>bijeenkomstfunctie,logiesfunctie</td>\n",
2022-04-14 15:43:51 +02:00
" <td>...</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Het Hogeland</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>verkiezingen@hethogeland.nl</td>\n",
" <td>https://hethogeland.nl/bestuur-en-organisatie/...</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>NLODSGM1966stembureaus20220316009</td>\n",
" <td>6df04b8dd4be4aa3b4a03f221ab5ad17</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>16708.725120</td>\n",
2022-04-14 15:43:51 +02:00
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>E2270N6185</td>\n",
" <td>0</td>\n",
" <td>POINT (227250.000 618750.000)</td>\n",
" <td>8</td>\n",
2022-04-20 13:03:38 +02:00
" <td>31030</td>\n",
" <td>Het Hogeland</td>\n",
" <td>GM1966</td>\n",
" <td>1</td>\n",
" <td>Dorpshuis Pieterburen</td>\n",
" <td>bijeenkomstfunctie,logiesfunctie</td>\n",
2022-04-14 15:43:51 +02:00
" <td>...</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Het Hogeland</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>verkiezingen@hethogeland.nl</td>\n",
" <td>https://hethogeland.nl/bestuur-en-organisatie/...</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>NLODSGM1966stembureaus20220316009</td>\n",
" <td>6df04b8dd4be4aa3b4a03f221ab5ad17</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>16738.249149</td>\n",
2022-04-14 15:43:51 +02:00
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>139997</th>\n",
" <td>E1990N3070</td>\n",
" <td>0</td>\n",
" <td>POINT (199250.000 307250.000)</td>\n",
" <td>151102</td>\n",
2022-04-20 13:03:38 +02:00
" <td>4107</td>\n",
" <td>Vaals</td>\n",
" <td>GM0981</td>\n",
" <td>7</td>\n",
" <td>Gemeentehuis (trouwkamer)</td>\n",
" <td>kantoorfunctie</td>\n",
2022-04-14 15:43:51 +02:00
" <td>...</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Vaals</td>\n",
" <td>ja</td>\n",
" <td>Team verkiezingen, verkiezingen2022@vaals.nl</td>\n",
" <td>http://www.vaals.nl/verkiezingen</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>NLODSGM0981stembureaus20220316009</td>\n",
" <td>cc2a21cff27c446ebe9cbd00472d9e44</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>1939.206985</td>\n",
" </tr>\n",
" <tr>\n",
" <th>139998</th>\n",
" <td>E1995N3070</td>\n",
" <td>0</td>\n",
" <td>POINT (199750.000 307250.000)</td>\n",
" <td>151103</td>\n",
2022-04-20 13:03:38 +02:00
" <td>4107</td>\n",
" <td>Vaals</td>\n",
" <td>GM0981</td>\n",
" <td>7</td>\n",
" <td>Gemeentehuis (trouwkamer)</td>\n",
" <td>kantoorfunctie</td>\n",
2022-04-14 15:43:51 +02:00
" <td>...</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Vaals</td>\n",
" <td>ja</td>\n",
" <td>Team verkiezingen, verkiezingen2022@vaals.nl</td>\n",
" <td>http://www.vaals.nl/verkiezingen</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>NLODSGM0981stembureaus20220316009</td>\n",
" <td>cc2a21cff27c446ebe9cbd00472d9e44</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>1923.094050</td>\n",
" </tr>\n",
" <tr>\n",
" <th>139999</th>\n",
" <td>E1910N3065</td>\n",
" <td>0</td>\n",
" <td>POINT (191250.000 306750.000)</td>\n",
" <td>151105</td>\n",
2022-04-20 13:03:38 +02:00
" <td>29739</td>\n",
" <td>Gulpen-Wittem</td>\n",
" <td>GM1729</td>\n",
2022-04-14 15:43:51 +02:00
" <td>7</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Gemeenschapshuis Patronaat</td>\n",
" <td>woonfunctie</td>\n",
2022-04-14 15:43:51 +02:00
" <td>...</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Gulpen-Wittem</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>info@gulpen-wittem.nl 14 043</td>\n",
" <td>https://www.gulpen-wittem.nl/onderwerpen/verki...</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>NLODSGM1729stembureaus20220316009</td>\n",
" <td>feb9d0a67a2f460f906d0d21e87bf690</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>2880.233287</td>\n",
" </tr>\n",
" <tr>\n",
" <th>140000</th>\n",
" <td>E1920N3065</td>\n",
" <td>20</td>\n",
" <td>POINT (192250.000 306750.000)</td>\n",
" <td>151106</td>\n",
2022-04-20 13:03:38 +02:00
" <td>29739</td>\n",
" <td>Gulpen-Wittem</td>\n",
" <td>GM1729</td>\n",
2022-04-14 15:43:51 +02:00
" <td>7</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Gemeenschapshuis Patronaat</td>\n",
" <td>woonfunctie</td>\n",
2022-04-14 15:43:51 +02:00
" <td>...</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Gulpen-Wittem</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>info@gulpen-wittem.nl 14 043</td>\n",
" <td>https://www.gulpen-wittem.nl/onderwerpen/verki...</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>NLODSGM1729stembureaus20220316009</td>\n",
" <td>feb9d0a67a2f460f906d0d21e87bf690</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>2746.345509</td>\n",
" </tr>\n",
" <tr>\n",
" <th>140001</th>\n",
" <td>E1925N3065</td>\n",
" <td>0</td>\n",
" <td>POINT (192750.000 306750.000)</td>\n",
" <td>151107</td>\n",
2022-04-20 13:03:38 +02:00
" <td>29739</td>\n",
" <td>Gulpen-Wittem</td>\n",
" <td>GM1729</td>\n",
2022-04-14 15:43:51 +02:00
" <td>7</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Gemeenschapshuis Patronaat</td>\n",
" <td>woonfunctie</td>\n",
2022-04-14 15:43:51 +02:00
" <td>...</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Gulpen-Wittem</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>info@gulpen-wittem.nl 14 043</td>\n",
" <td>https://www.gulpen-wittem.nl/onderwerpen/verki...</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>NLODSGM1729stembureaus20220316009</td>\n",
" <td>feb9d0a67a2f460f906d0d21e87bf690</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>2813.494018</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
2022-04-20 13:03:38 +02:00
"<p>140002 rows × 46 columns</p>\n",
2022-04-14 15:43:51 +02:00
"</div>"
],
"text/plain": [
2022-04-20 13:03:38 +02:00
" c28992r500 INWONER geometry savedindex _id \\\n",
"0 E2270N6190 0 POINT (227250.000 619250.000) 2 31030 \n",
"1 E2275N6190 0 POINT (227750.000 619250.000) 3 31030 \n",
"2 E2280N6190 0 POINT (228250.000 619250.000) 4 31030 \n",
"3 E2265N6185 0 POINT (226750.000 618750.000) 7 31030 \n",
"4 E2270N6185 0 POINT (227250.000 618750.000) 8 31030 \n",
"... ... ... ... ... ... \n",
"139997 E1990N3070 0 POINT (199250.000 307250.000) 151102 4107 \n",
"139998 E1995N3070 0 POINT (199750.000 307250.000) 151103 4107 \n",
"139999 E1910N3065 0 POINT (191250.000 306750.000) 151105 29739 \n",
"140000 E1920N3065 20 POINT (192250.000 306750.000) 151106 29739 \n",
"140001 E1925N3065 0 POINT (192750.000 306750.000) 151107 29739 \n",
"\n",
" Gemeente CBS gemeentecode Nummer stembureau \\\n",
"0 Het Hogeland GM1966 1 \n",
"1 Het Hogeland GM1966 1 \n",
"2 Het Hogeland GM1966 1 \n",
"3 Het Hogeland GM1966 1 \n",
"4 Het Hogeland GM1966 1 \n",
"... ... ... ... \n",
"139997 Vaals GM0981 7 \n",
"139998 Vaals GM0981 7 \n",
"139999 Gulpen-Wittem GM1729 7 \n",
"140000 Gulpen-Wittem GM1729 7 \n",
"140001 Gulpen-Wittem GM1729 7 \n",
"\n",
" Naam stembureau Gebruiksdoel van het gebouw ... \\\n",
"0 Dorpshuis Pieterburen bijeenkomstfunctie,logiesfunctie ... \n",
"1 Dorpshuis Pieterburen bijeenkomstfunctie,logiesfunctie ... \n",
"2 Dorpshuis Pieterburen bijeenkomstfunctie,logiesfunctie ... \n",
"3 Dorpshuis Pieterburen bijeenkomstfunctie,logiesfunctie ... \n",
"4 Dorpshuis Pieterburen bijeenkomstfunctie,logiesfunctie ... \n",
"... ... ... ... \n",
"139997 Gemeentehuis (trouwkamer) kantoorfunctie ... \n",
"139998 Gemeentehuis (trouwkamer) kantoorfunctie ... \n",
"139999 Gemeenschapshuis Patronaat woonfunctie ... \n",
"140000 Gemeenschapshuis Patronaat woonfunctie ... \n",
"140001 Gemeenschapshuis Patronaat woonfunctie ... \n",
"\n",
" Hoofdstembureau Tellocatie \\\n",
"0 Het Hogeland NaN \n",
"1 Het Hogeland NaN \n",
"2 Het Hogeland NaN \n",
"3 Het Hogeland NaN \n",
"4 Het Hogeland NaN \n",
"... ... ... \n",
"139997 Vaals ja \n",
"139998 Vaals ja \n",
"139999 Gulpen-Wittem NaN \n",
"140000 Gulpen-Wittem NaN \n",
"140001 Gulpen-Wittem NaN \n",
"\n",
" Contactgegevens gemeente \\\n",
"0 verkiezingen@hethogeland.nl \n",
"1 verkiezingen@hethogeland.nl \n",
"2 verkiezingen@hethogeland.nl \n",
"3 verkiezingen@hethogeland.nl \n",
"4 verkiezingen@hethogeland.nl \n",
"... ... \n",
"139997 Team verkiezingen, verkiezingen2022@vaals.nl \n",
"139998 Team verkiezingen, verkiezingen2022@vaals.nl \n",
"139999 info@gulpen-wittem.nl 14 043 \n",
"140000 info@gulpen-wittem.nl 14 043 \n",
"140001 info@gulpen-wittem.nl 14 043 \n",
"\n",
" Verkiezingswebsite gemeente Verkiezingen \\\n",
"0 https://hethogeland.nl/bestuur-en-organisatie/... NaN \n",
"1 https://hethogeland.nl/bestuur-en-organisatie/... NaN \n",
"2 https://hethogeland.nl/bestuur-en-organisatie/... NaN \n",
"3 https://hethogeland.nl/bestuur-en-organisatie/... NaN \n",
"4 https://hethogeland.nl/bestuur-en-organisatie/... NaN \n",
"... ... ... \n",
"139997 http://www.vaals.nl/verkiezingen NaN \n",
"139998 http://www.vaals.nl/verkiezingen NaN \n",
"139999 https://www.gulpen-wittem.nl/onderwerpen/verki... NaN \n",
"140000 https://www.gulpen-wittem.nl/onderwerpen/verki... NaN \n",
"140001 https://www.gulpen-wittem.nl/onderwerpen/verki... NaN \n",
"\n",
" ID UUID \\\n",
"0 NLODSGM1966stembureaus20220316009 6df04b8dd4be4aa3b4a03f221ab5ad17 \n",
"1 NLODSGM1966stembureaus20220316009 6df04b8dd4be4aa3b4a03f221ab5ad17 \n",
"2 NLODSGM1966stembureaus20220316009 6df04b8dd4be4aa3b4a03f221ab5ad17 \n",
"3 NLODSGM1966stembureaus20220316009 6df04b8dd4be4aa3b4a03f221ab5ad17 \n",
"4 NLODSGM1966stembureaus20220316009 6df04b8dd4be4aa3b4a03f221ab5ad17 \n",
"... ... ... \n",
"139997 NLODSGM0981stembureaus20220316009 cc2a21cff27c446ebe9cbd00472d9e44 \n",
"139998 NLODSGM0981stembureaus20220316009 cc2a21cff27c446ebe9cbd00472d9e44 \n",
"139999 NLODSGM1729stembureaus20220316009 feb9d0a67a2f460f906d0d21e87bf690 \n",
"140000 NLODSGM1729stembureaus20220316009 feb9d0a67a2f460f906d0d21e87bf690 \n",
"140001 NLODSGM1729stembureaus20220316009 feb9d0a67a2f460f906d0d21e87bf690 \n",
"\n",
" Unnamed: 39 Unnamed: 40 dist \n",
"0 NaN NaN 17236.920436 \n",
"1 NaN NaN 17280.014918 \n",
"2 NaN NaN 17337.427867 \n",
"3 NaN NaN 16708.725120 \n",
"4 NaN NaN 16738.249149 \n",
"... ... ... ... \n",
"139997 NaN NaN 1939.206985 \n",
"139998 NaN NaN 1923.094050 \n",
"139999 NaN NaN 2880.233287 \n",
"140000 NaN NaN 2746.345509 \n",
"140001 NaN NaN 2813.494018 \n",
"\n",
"[140002 rows x 46 columns]"
2022-04-14 15:43:51 +02:00
]
},
2022-04-20 13:03:38 +02:00
"execution_count": 36,
2022-04-13 15:08:29 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
2022-04-14 15:43:51 +02:00
"nl_map_dst_zero_points[\"INWONER\"].mask(nl_map_dst_zero_points[\"INWONER\"] == -99997, 0, inplace=True)\n",
"nl_map_dst_zero_points.head()\n",
2022-04-20 13:03:38 +02:00
"df_nearest_zero = ckdnearest(nl_map_dst_zero_points.to_crs(epsg=28992), gdf_wims.to_crs(epsg=28992))\n",
2022-04-14 15:43:51 +02:00
"df_nearest_zero[\"INWONER\"].dropna()\n",
"df_nearest_zero[\"dist\"].dropna()\n",
"df_nearest_zero"
2022-04-13 15:08:29 +02:00
]
},
{
"cell_type": "code",
2022-04-20 13:03:38 +02:00
"execution_count": 37,
2022-04-14 15:43:51 +02:00
"metadata": {},
2022-04-13 15:08:29 +02:00
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>c28992r500</th>\n",
" <th>INWONER</th>\n",
" <th>geometry</th>\n",
2022-04-14 15:43:51 +02:00
" <th>savedindex</th>\n",
2022-04-20 13:03:38 +02:00
" <th>_id</th>\n",
" <th>Gemeente</th>\n",
" <th>CBS gemeentecode</th>\n",
" <th>Nummer stembureau</th>\n",
" <th>Naam stembureau</th>\n",
" <th>Gebruiksdoel van het gebouw</th>\n",
2022-04-13 15:08:29 +02:00
" <th>...</th>\n",
2022-04-20 13:03:38 +02:00
" <th>Hoofdstembureau</th>\n",
" <th>Tellocatie</th>\n",
" <th>Contactgegevens gemeente</th>\n",
" <th>Verkiezingswebsite gemeente</th>\n",
" <th>Verkiezingen</th>\n",
" <th>ID</th>\n",
" <th>UUID</th>\n",
" <th>Unnamed: 39</th>\n",
" <th>Unnamed: 40</th>\n",
2022-04-13 15:08:29 +02:00
" <th>dist</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
2022-04-14 15:43:51 +02:00
" <th>47198</th>\n",
" <td>E1005N4315</td>\n",
" <td>1420</td>\n",
" <td>POINT (100750.000 431750.000)</td>\n",
" <td>103081</td>\n",
2022-04-20 13:03:38 +02:00
" <td>4344</td>\n",
" <td>Ridderkerk</td>\n",
" <td>GM0597</td>\n",
2022-04-13 15:08:29 +02:00
" <td>1</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Gemeentehuis</td>\n",
" <td>bijeenkomstfunctie,kantoorfunctie</td>\n",
2022-04-13 15:08:29 +02:00
" <td>...</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Ridderkerk</td>\n",
" <td>ja</td>\n",
" <td>Team Verkiezingen, info@ridderkerk.nl, 0180-45...</td>\n",
" <td>https://verkiezingen.ridderkerk.nl</td>\n",
2022-04-13 15:08:29 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>NLODSGM0597stembureaus20220316009</td>\n",
" <td>5a2769a4515b438c8688b3dbfaeb122d</td>\n",
2022-04-13 15:08:29 +02:00
" <td>NaN</td>\n",
" <td>NaN</td>\n",
2022-04-14 15:43:51 +02:00
" <td>3.835321</td>\n",
2022-04-13 15:08:29 +02:00
" </tr>\n",
" <tr>\n",
2022-04-14 15:43:51 +02:00
" <th>32760</th>\n",
" <td>E1435N4655</td>\n",
" <td>155</td>\n",
" <td>POINT (143750.000 465750.000)</td>\n",
" <td>78211</td>\n",
2022-04-20 13:03:38 +02:00
" <td>36545</td>\n",
" <td>Baarn</td>\n",
" <td>GM0308</td>\n",
2022-04-14 15:43:51 +02:00
" <td>6</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Dorpshuis de Furs</td>\n",
" <td>woonfunctie</td>\n",
2022-04-14 15:43:51 +02:00
" <td>...</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Baarn</td>\n",
" <td>ja</td>\n",
" <td>verkiezingen@baarn.nl</td>\n",
" <td>http://www.baarn.nl/verkiezingen</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>NLODSGM0308stembureaus20220316009</td>\n",
" <td>3a1d2164cad34a7fb0b6249930491a6d</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>4.000517</td>\n",
" </tr>\n",
" <tr>\n",
" <th>46560</th>\n",
" <td>E1970N4335</td>\n",
" <td>910</td>\n",
" <td>POINT (197250.000 433750.000)</td>\n",
" <td>101861</td>\n",
2022-04-20 13:03:38 +02:00
" <td>20667</td>\n",
" <td>Lingewaard</td>\n",
" <td>GM1705</td>\n",
2022-04-14 15:43:51 +02:00
" <td>51</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Ontmoetingscentrum Doornenburg</td>\n",
" <td>bijeenkomstfunctie</td>\n",
2022-04-14 15:43:51 +02:00
" <td>...</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Lingewaard</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>verkiezingen@lingewaard.nl</td>\n",
" <td>https://lingewaardkiest.nl/</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>NLODSGM1705stembureaus20220316009</td>\n",
" <td>a8ddb12683d94507a6c88197360485db</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>4.465340</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5146</th>\n",
" <td>E2405N5710</td>\n",
" <td>270</td>\n",
" <td>POINT (240750.000 571250.000)</td>\n",
" <td>15468</td>\n",
" <td>31912</td>\n",
" <td>Groningen</td>\n",
" <td>GM0014</td>\n",
" <td>1</td>\n",
" <td>Dorpshuis De Hoeksteen</td>\n",
" <td>woonfunctie</td>\n",
" <td>...</td>\n",
" <td>Groningen</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>telefoon: 14 050</td>\n",
" <td>https://gemeente.groningen.nl/verkiezingen</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>NLODSGM0014stembureaus20220316009</td>\n",
" <td>fb222b59f52242d39476a0c6e301df47</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>5.577246</td>\n",
2022-04-14 15:43:51 +02:00
" </tr>\n",
" <tr>\n",
" <th>38896</th>\n",
" <td>E1245N4505</td>\n",
" <td>880</td>\n",
" <td>POINT (124750.000 450750.000)</td>\n",
" <td>88659</td>\n",
2022-04-20 13:03:38 +02:00
" <td>31188</td>\n",
" <td>Montfoort</td>\n",
" <td>GM0335</td>\n",
2022-04-13 15:08:29 +02:00
" <td>1</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Zalencentrum St. Joseph</td>\n",
" <td>bijeenkomstfunctie</td>\n",
2022-04-13 15:08:29 +02:00
" <td>...</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Montfoort</td>\n",
2022-04-13 15:08:29 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>info@montfoort.nl</td>\n",
" <td>https://www.montfoort.nl/mozard/!suite86.scher...</td>\n",
2022-04-13 15:08:29 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>NLODSGM0335stembureaus20220316009</td>\n",
" <td>8b747761aa7f417ebd4958b0d1284672</td>\n",
2022-04-13 15:08:29 +02:00
" <td>NaN</td>\n",
" <td>NaN</td>\n",
2022-04-14 15:43:51 +02:00
" <td>5.703409</td>\n",
2022-04-13 15:08:29 +02:00
" </tr>\n",
" <tr>\n",
2022-04-14 15:43:51 +02:00
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
2022-04-20 13:03:38 +02:00
" <th>22439</th>\n",
" <td>E1590N4920</td>\n",
" <td>10</td>\n",
" <td>POINT (159250.000 492250.000)</td>\n",
" <td>59523</td>\n",
" <td>11208</td>\n",
" <td>Lelystad</td>\n",
" <td>GM0995</td>\n",
" <td>22</td>\n",
" <td>Gymzaal Kindcentrum Warande</td>\n",
" <td>kantoorfunctie,onderwijsfunctie,sportfunctie,o...</td>\n",
2022-04-14 15:43:51 +02:00
" <td>...</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Lelystad</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Gemeente Lelystad, Bureau Verkiezingen, Postbu...</td>\n",
" <td>https://www.lelystad.nl/VerkiezingenStemmen</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>NLODSGM0995stembureaus20220316009</td>\n",
" <td>7c0bfe588d34460dad294172ff402c94</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>8135.260944</td>\n",
2022-04-14 15:43:51 +02:00
" </tr>\n",
" <tr>\n",
2022-04-20 13:03:38 +02:00
" <th>22441</th>\n",
" <td>E1670N4920</td>\n",
" <td>5</td>\n",
" <td>POINT (167250.000 492250.000)</td>\n",
" <td>59539</td>\n",
" <td>36039</td>\n",
" <td>Harderwijk</td>\n",
" <td>GM0243</td>\n",
" <td>28</td>\n",
" <td>Drive-In op parkeerplaats P2</td>\n",
" <td>overige gebruiksfunctie</td>\n",
2022-04-13 15:08:29 +02:00
" <td>...</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Harderwijk</td>\n",
2022-04-13 15:08:29 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Team verkiezingen, burgerzaken@harderwijk.nl</td>\n",
" <td>https://www.harderwijk.nl/verkiezingen</td>\n",
2022-04-13 15:08:29 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>NLODSGM0243stembureaus20220316009</td>\n",
" <td>5012c8e95b1349fe90d83abdc683c50b</td>\n",
2022-04-13 15:08:29 +02:00
" <td>NaN</td>\n",
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>8167.139659</td>\n",
2022-04-13 15:08:29 +02:00
" </tr>\n",
" <tr>\n",
2022-04-20 13:03:38 +02:00
" <th>51985</th>\n",
" <td>E2000N4140</td>\n",
" <td>20</td>\n",
" <td>POINT (200250.000 414250.000)</td>\n",
" <td>114100</td>\n",
" <td>16686</td>\n",
" <td>Berg en Dal</td>\n",
" <td>GM1945</td>\n",
2022-04-14 15:43:51 +02:00
" <td>10</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Zalencentrum De Sleutel</td>\n",
" <td>bijeenkomstfunctie</td>\n",
2022-04-13 15:08:29 +02:00
" <td>...</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Berg en Dal</td>\n",
" <td>ja</td>\n",
" <td>verkiezingen@bergendal.nl</td>\n",
" <td>http://www.bergendal.nl/verkiezingen</td>\n",
2022-04-13 15:08:29 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>NLODSGM1945stembureaus20220316009</td>\n",
" <td>02745c1ebd904df893190b466c541228</td>\n",
2022-04-13 15:08:29 +02:00
" <td>NaN</td>\n",
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>8232.928809</td>\n",
2022-04-13 15:08:29 +02:00
" </tr>\n",
" <tr>\n",
2022-04-14 15:43:51 +02:00
" <th>22440</th>\n",
" <td>E1620N4920</td>\n",
" <td>5</td>\n",
" <td>POINT (162250.000 492250.000)</td>\n",
" <td>59529</td>\n",
2022-04-20 13:03:38 +02:00
" <td>11199</td>\n",
" <td>Lelystad</td>\n",
" <td>GM0995</td>\n",
2022-04-14 15:43:51 +02:00
" <td>33</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Gymzaal De Borg</td>\n",
" <td>onderwijsfunctie</td>\n",
2022-04-13 15:08:29 +02:00
" <td>...</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Lelystad</td>\n",
2022-04-13 15:08:29 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Gemeente Lelystad, Bureau Verkiezingen, Postbu...</td>\n",
" <td>https://www.lelystad.nl/VerkiezingenStemmen</td>\n",
2022-04-13 15:08:29 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>NLODSGM0995stembureaus20220316009</td>\n",
" <td>72de608fefe14b4da1e232488802a819</td>\n",
2022-04-13 15:08:29 +02:00
" <td>NaN</td>\n",
" <td>NaN</td>\n",
2022-04-14 15:43:51 +02:00
" <td>8402.730770</td>\n",
" </tr>\n",
" <tr>\n",
" <th>22583</th>\n",
" <td>E1595N4915</td>\n",
" <td>10</td>\n",
" <td>POINT (159750.000 491750.000)</td>\n",
" <td>59865</td>\n",
2022-04-20 13:03:38 +02:00
" <td>11208</td>\n",
" <td>Lelystad</td>\n",
" <td>GM0995</td>\n",
2022-04-14 15:43:51 +02:00
" <td>22</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Gymzaal Kindcentrum Warande</td>\n",
" <td>kantoorfunctie,onderwijsfunctie,sportfunctie,o...</td>\n",
2022-04-14 15:43:51 +02:00
" <td>...</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Lelystad</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>Gemeente Lelystad, Bureau Verkiezingen, Postbu...</td>\n",
" <td>https://www.lelystad.nl/VerkiezingenStemmen</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
2022-04-20 13:03:38 +02:00
" <td>NLODSGM0995stembureaus20220316009</td>\n",
" <td>7c0bfe588d34460dad294172ff402c94</td>\n",
2022-04-14 15:43:51 +02:00
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>8685.023942</td>\n",
2022-04-13 15:08:29 +02:00
" </tr>\n",
" </tbody>\n",
"</table>\n",
2022-04-20 13:03:38 +02:00
"<p>67995 rows × 46 columns</p>\n",
2022-04-13 15:08:29 +02:00
"</div>"
],
"text/plain": [
2022-04-20 13:03:38 +02:00
" c28992r500 INWONER geometry savedindex _id \\\n",
"47198 E1005N4315 1420 POINT (100750.000 431750.000) 103081 4344 \n",
"32760 E1435N4655 155 POINT (143750.000 465750.000) 78211 36545 \n",
"46560 E1970N4335 910 POINT (197250.000 433750.000) 101861 20667 \n",
"5146 E2405N5710 270 POINT (240750.000 571250.000) 15468 31912 \n",
"38896 E1245N4505 880 POINT (124750.000 450750.000) 88659 31188 \n",
"... ... ... ... ... ... \n",
"22439 E1590N4920 10 POINT (159250.000 492250.000) 59523 11208 \n",
"22441 E1670N4920 5 POINT (167250.000 492250.000) 59539 36039 \n",
"51985 E2000N4140 20 POINT (200250.000 414250.000) 114100 16686 \n",
"22440 E1620N4920 5 POINT (162250.000 492250.000) 59529 11199 \n",
"22583 E1595N4915 10 POINT (159750.000 491750.000) 59865 11208 \n",
2022-04-13 15:08:29 +02:00
"\n",
2022-04-20 13:03:38 +02:00
" Gemeente CBS gemeentecode Nummer stembureau \\\n",
"47198 Ridderkerk GM0597 1 \n",
"32760 Baarn GM0308 6 \n",
"46560 Lingewaard GM1705 51 \n",
"5146 Groningen GM0014 1 \n",
"38896 Montfoort GM0335 1 \n",
"... ... ... ... \n",
"22439 Lelystad GM0995 22 \n",
"22441 Harderwijk GM0243 28 \n",
"51985 Berg en Dal GM1945 10 \n",
"22440 Lelystad GM0995 33 \n",
"22583 Lelystad GM0995 22 \n",
2022-04-13 15:08:29 +02:00
"\n",
2022-04-20 13:03:38 +02:00
" Naam stembureau \\\n",
"47198 Gemeentehuis \n",
"32760 Dorpshuis de Furs \n",
"46560 Ontmoetingscentrum Doornenburg \n",
"5146 Dorpshuis De Hoeksteen \n",
"38896 Zalencentrum St. Joseph \n",
"... ... \n",
"22439 Gymzaal Kindcentrum Warande \n",
"22441 Drive-In op parkeerplaats P2 \n",
"51985 Zalencentrum De Sleutel \n",
"22440 Gymzaal De Borg \n",
"22583 Gymzaal Kindcentrum Warande \n",
2022-04-13 15:08:29 +02:00
"\n",
2022-04-20 13:03:38 +02:00
" Gebruiksdoel van het gebouw ... Hoofdstembureau \\\n",
"47198 bijeenkomstfunctie,kantoorfunctie ... Ridderkerk \n",
"32760 woonfunctie ... Baarn \n",
"46560 bijeenkomstfunctie ... Lingewaard \n",
"5146 woonfunctie ... Groningen \n",
"38896 bijeenkomstfunctie ... Montfoort \n",
"... ... ... ... \n",
"22439 kantoorfunctie,onderwijsfunctie,sportfunctie,o... ... Lelystad \n",
"22441 overige gebruiksfunctie ... Harderwijk \n",
"51985 bijeenkomstfunctie ... Berg en Dal \n",
"22440 onderwijsfunctie ... Lelystad \n",
"22583 kantoorfunctie,onderwijsfunctie,sportfunctie,o... ... Lelystad \n",
2022-04-14 15:43:51 +02:00
"\n",
2022-04-20 13:03:38 +02:00
" Tellocatie Contactgegevens gemeente \\\n",
"47198 ja Team Verkiezingen, info@ridderkerk.nl, 0180-45... \n",
"32760 ja verkiezingen@baarn.nl \n",
"46560 NaN verkiezingen@lingewaard.nl \n",
"5146 NaN telefoon: 14 050 \n",
"38896 NaN info@montfoort.nl \n",
"... ... ... \n",
"22439 NaN Gemeente Lelystad, Bureau Verkiezingen, Postbu... \n",
"22441 NaN Team verkiezingen, burgerzaken@harderwijk.nl \n",
"51985 ja verkiezingen@bergendal.nl \n",
"22440 NaN Gemeente Lelystad, Bureau Verkiezingen, Postbu... \n",
"22583 NaN Gemeente Lelystad, Bureau Verkiezingen, Postbu... \n",
"\n",
" Verkiezingswebsite gemeente Verkiezingen \\\n",
"47198 https://verkiezingen.ridderkerk.nl NaN \n",
"32760 http://www.baarn.nl/verkiezingen NaN \n",
"46560 https://lingewaardkiest.nl/ NaN \n",
"5146 https://gemeente.groningen.nl/verkiezingen NaN \n",
"38896 https://www.montfoort.nl/mozard/!suite86.scher... NaN \n",
"... ... ... \n",
"22439 https://www.lelystad.nl/VerkiezingenStemmen NaN \n",
"22441 https://www.harderwijk.nl/verkiezingen NaN \n",
"51985 http://www.bergendal.nl/verkiezingen NaN \n",
"22440 https://www.lelystad.nl/VerkiezingenStemmen NaN \n",
"22583 https://www.lelystad.nl/VerkiezingenStemmen NaN \n",
"\n",
" ID UUID \\\n",
"47198 NLODSGM0597stembureaus20220316009 5a2769a4515b438c8688b3dbfaeb122d \n",
"32760 NLODSGM0308stembureaus20220316009 3a1d2164cad34a7fb0b6249930491a6d \n",
"46560 NLODSGM1705stembureaus20220316009 a8ddb12683d94507a6c88197360485db \n",
"5146 NLODSGM0014stembureaus20220316009 fb222b59f52242d39476a0c6e301df47 \n",
"38896 NLODSGM0335stembureaus20220316009 8b747761aa7f417ebd4958b0d1284672 \n",
"... ... ... \n",
"22439 NLODSGM0995stembureaus20220316009 7c0bfe588d34460dad294172ff402c94 \n",
"22441 NLODSGM0243stembureaus20220316009 5012c8e95b1349fe90d83abdc683c50b \n",
"51985 NLODSGM1945stembureaus20220316009 02745c1ebd904df893190b466c541228 \n",
"22440 NLODSGM0995stembureaus20220316009 72de608fefe14b4da1e232488802a819 \n",
"22583 NLODSGM0995stembureaus20220316009 7c0bfe588d34460dad294172ff402c94 \n",
"\n",
" Unnamed: 39 Unnamed: 40 dist \n",
"47198 NaN NaN 3.835321 \n",
"32760 NaN NaN 4.000517 \n",
"46560 NaN NaN 4.465340 \n",
"5146 NaN NaN 5.577246 \n",
"38896 NaN NaN 5.703409 \n",
"... ... ... ... \n",
"22439 NaN NaN 8135.260944 \n",
"22441 NaN NaN 8167.139659 \n",
"51985 NaN NaN 8232.928809 \n",
"22440 NaN NaN 8402.730770 \n",
"22583 NaN NaN 8685.023942 \n",
"\n",
"[67995 rows x 46 columns]"
2022-04-13 15:08:29 +02:00
]
},
2022-04-20 13:03:38 +02:00
"execution_count": 37,
2022-04-13 15:08:29 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
2022-04-14 15:43:51 +02:00
"df_nearest.sort_values(by=['dist'], inplace=True)\n",
"df_nearest"
2022-04-13 15:08:29 +02:00
]
},
{
"cell_type": "code",
2022-04-20 13:03:38 +02:00
"execution_count": 38,
2022-04-13 15:08:29 +02:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
2022-04-14 15:43:51 +02:00
"<AxesSubplot:xlabel='Inwoners per 500m² (laagste is 5)', ylabel='Afstand tot stemlokaal (meter)'>"
2022-04-13 15:08:29 +02:00
]
},
2022-04-20 13:03:38 +02:00
"execution_count": 38,
2022-04-13 15:08:29 +02:00
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
2022-04-20 13:03:38 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAxIAAALwCAYAAAADP0P2AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAACegklEQVR4nOz9e5xdZX33/7+vtfZhJpmcnAAhmXAckCYxiRgNOEgFrSKE6H0HqAWqbVXuu1+xB5XE1hsR+dmagPaWQrWKt0pLa4HUJhw8UAJCKKBBk2kSThGETMJxTEImmdmHta7fH3v2ZB/WPs2sPbP3ntfz8UjJrH2Ya3Zic33W9TkYa60AAAAAoBbORC8AAAAAQPMhkAAAAABQMwIJAAAAADUjkAAAAABQMwIJAAAAADUjkAAAAABQs8hEL6BeZs+ebU844YSJXgYAAADQtJ544onXrbVHBT3WsoHECSecoC1btkz0MgAAAICmZYx5odRjpDYBAAAAqBmBBAAAAICaEUgAAAAAqBmBBAAAAICaEUgAAAAAqBmBBAAAAICaEUgAAAAAqBmBBAAAAICaEUgAAAAAqBmBBAAAAICaEUgAAAAAqBmBBAAAAICaEUgAAAAAqBmBBAAAAICaEUgAAA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9EEiErGtWu6IRU3TdtyKtCQAAAC2DQCJknR1xXX/REkVyPtmoa3T9RfnTrfsHEtq2ez9dnAAAANCUGEhXByuXzlNP92zt2PuGJKuFc2fkBRG5A+tSvq91qxZr5dJ5E7dgAAAAoEYEEnXS2RHX2aceVXQ9d2DdkHxJ0ur1verpnk0hNgA
2022-04-13 15:08:29 +02:00
"text/plain": [
2022-04-14 15:43:51 +02:00
"<Figure size 936x936 with 1 Axes>"
2022-04-13 15:08:29 +02:00
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
2022-04-14 15:43:51 +02:00
"df_nearest.plot.scatter(x = 'INWONER', y = 'dist', figsize=(13,13), xlabel=\"Inwoners per 500m² (laagste is 5)\", ylabel=\"Afstand tot stemlokaal (meter)\")"
2022-04-13 15:08:29 +02:00
]
},
{
2022-04-14 15:43:51 +02:00
"cell_type": "code",
2022-04-20 13:03:38 +02:00
"execution_count": 39,
2022-04-13 15:08:29 +02:00
"metadata": {},
2022-04-14 15:43:51 +02:00
"outputs": [
{
"data": {
"text/plain": [
"<AxesSubplot:xlabel='Inwoners per 500m² (inclusief lege (<5 inwoners) vierkanten)', ylabel='Afstand tot stemlokaal (meter)'>"
]
},
2022-04-20 13:03:38 +02:00
"execution_count": 39,
2022-04-14 15:43:51 +02:00
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
2022-04-20 13:03:38 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAxgAAALwCAYAAAAUHdM/AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAACFX0lEQVR4nO39eZxcVZ3/8b8/tXR1p7PSCYGkAwECaIJJkIzABBlBRxER/P5ARFF01GHGn7iMSnAZ95/jAOqMiDqD6AgjopiMEnCDYZFlIBKwE5KwtWzpJAZosnXSXd1VdX5/1K1O7V3VXX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KxP/NObfU+/mNJJnZQkkXSFrkPed7ZpbZge77ki6WdLT3kznnByTtcM4tkPRvki6v1xuphTnTOqqKAwAAAEFUtwTDOXePpJcrPPwcST9zzsWdc89I6pX0GjM7VNJU59wDzjkn6XpJb8t6znXe7ZWSXp8Z3WhGe4eTioZzmxcNm/YOJxvUIgAAAKD2GlGDcYmZrfemUM3wYnMlbc46ps+LzfVu58dznuOcS0jaJamrng2fiM62sEaSudOhRpJOnW3hEs8AAAAAgsfvBOP7ko6StFTSNknf9OLFRh5cmXi55xQws4vNbK2ZrX3xxReranCtbN1VfEO9UnEAAAAgiHxNMJxz251zSedcStIPJL3Ge6hP0rysQ7slbfXi3UXiOc8xs4ikaSoxJcs5d41zbplzbtmsWbNq9XaqsnswUVUcAAAACCJfEwyvpiLj/0nKrDC1WtIF3spQRyhdzP1H59w2SXvM7CSvvuIiSTdnPee93u3zJN3p1Wk0pakdkariAAAAQBDVrXdrZjdKep2kmWb
2022-04-14 15:43:51 +02:00
"text/plain": [
"<Figure size 936x936 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
2022-04-13 15:08:29 +02:00
"source": [
2022-04-14 15:43:51 +02:00
"df_nearest_zero.plot.scatter(x = 'INWONER', y = 'dist', figsize=(13,13), xlabel=\"Inwoners per 500m² (inclusief lege (<5 inwoners) vierkanten)\", ylabel=\"Afstand tot stemlokaal (meter)\")"
2022-04-13 15:08:29 +02:00
]
},
{
"cell_type": "code",
2022-04-20 13:03:38 +02:00
"execution_count": 40,
"metadata": {},
"outputs": [],
"source": [
"FIGSIZE = (13, 13)\n",
"def plot_bargraph_with_groupings(df, groupby, colourby, title, xlabel, ylabel):\n",
" \"\"\"\n",
" Plots a dataframe showing the frequency of datapoints grouped by one column and coloured by another.\n",
" df : dataframe\n",
" groupby: the column to groupby\n",
" colourby: the column to color by\n",
" title: the graph title\n",
" xlabel: the x label,\n",
" ylabel: the y label\n",
" \"\"\"\n",
"\n",
" import matplotlib.patches as mpatches\n",
"\n",
" # Makes a mapping from the unique colourby column items to a random color.\n",
"\n",
"\n",
" # Find when the indicies of the soon to be bar graphs colors.\n",
" \n",
"\n",
" # Makes the bargraph.\n",
" ax = df[groupby].value_counts().plot(kind='bar',\n",
" figsize=FIGSIZE,\n",
" title=title)\n",
" # Makes a legend using the ind_col_map\n",
" \n",
"\n",
" # display the graph.\n",
" \n",
" ax.set_xlabel(xlabel)\n",
" ax.set_ylabel(ylabel)"
]
},
{
"cell_type": "code",
"execution_count": 41,
"metadata": {
"scrolled": true
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAxQAAAV9CAYAAABpqAo5AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAEAAElEQVR4nOzde7xnY93/8fdnDsw4mwxNToOGQhESKce6KTl0UCpRKSpFd6ebTui+FZ3TWXdF3ZV0pKSSpF9SGoxzSg4ROSRMCDM+vz8+13f22ut7XWuvtcw2s3k9H4/92N997fW91mddp7Wu7zp8zd0FAAAAAH1MWtIBAAAAAJi4mFAAAAAA6I0JBQAAAIDemFAAAAAA6I0JBQAAAIDemFAAAAAA6I0JBQB0ZGY7mtmNiznPf5nZ+un1iWb2P4shTzezJy4t+TwWdWkrfevdzF5tZr/pHh0ALB5MKAA8JpnZvmb2ezO7x8xuTa/fZGa2JOJx9xXc/Zolse5HOzNby8y+Z2a3m9ldZnapmb06/W92mjBNWcJhAsCExYQCwGOOmb1d0qckfUTS4yWtIekNkraTtMw4rG/y4s4TnXxd0g2S1pX0OEn7S7pliUYEAI8iTCgAPKaY2cqSPiDpTe7+XXef7+Eid3+lu9+fllvWzD5qZn81s1vM7AtmNr2W17vTp97XmdkrK+knmtnnzewnZnaPpJ3M7Fdm9rrKMqMuUyldVmRmK5rZ2WZ2vIXnm9kVZjbfzP5mZu+o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WEmnmNmBkv4qaR9JcvfLzewUSVdIWiDpEHdfmN7zRkknSpou6Yz0AwAAAGAJe0QmFO7+K0m/Sq//IWmXwnLHSDomkz5X0qbjFyEAAACAPvimbAAAAAC9MaE
"text/plain": [
"<Figure size 936x936 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"plot_bargraph_with_groupings(gdf_wims, 'Gebruiksdoel van het gebouw', 'Gemeente', 'Gebruiksdoelen van Stemlokalen', 'Gebruiksdoel', 'Hoeveelheid Stemlokalen')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Dit is onbruikbaar, de categorieën moeten elk één balkje zijn, niet zoals dit."
]
},
{
"cell_type": "code",
"execution_count": 42,
"metadata": {},
"outputs": [],
"source": [
"gdf_wims_exploded = gdf_wims.drop('Gebruiksdoel van het gebouw', axis=1).join(\n",
" gdf_wims['Gebruiksdoel van het gebouw'].str.split(',', expand=True).stack().reset_index(level=1,drop=True).rename('Gebruiksdoel van het gebouw'))"
]
},
{
"cell_type": "code",
"execution_count": 43,
2022-04-13 15:08:29 +02:00
"metadata": {},
"outputs": [
{
2022-04-20 13:03:38 +02:00
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAxIAAANtCAYAAAAEsE3fAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAABXI0lEQVR4nO3de7x+9Zz//8ezQkmpVPh2xIQhig4OYYxjRHKOIkRO4ziDYjCYDMYw+DmPIYf41piU8yFEipRKKb5MOk1ROZXQyev3x1q7z9Vufz6f/c7e19r7sx73223f9rXe12G/9tr7uq71vNb7kKpCkiRJklqsNXQBkiRJkpYfg4QkSZKkZgYJSZIkSc0MEpIkSZKaGSQkSZIkNTNISJIkSWpmkJCkRknun+T8BX7M3ye5bX/5I0n+eQEes5L81VJ5nD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AvYE7A7sD70mydn+f9wIHANv1X7tPoW5JkiRJKzFE16ZHAYf0lw8B9ppo/1RVXVFVPwd+Buya5NbAhlV1fFUV8NGJ+0iSJEkawGIHiQK+kuSkJAf0bbesqgsB+u+b9+1bAOdN3Pf8vm2L/vLs9utJckCSE5OcePHFFy/gryFJkiRp0jqL/Pi7VdUFSTYHvprkx6u47VzjHmoV7ddvrPoA8AGAnXfeec7bSJIkSfrLLeoZiaq6oP9+EXAEsCvwy767Ev33i/qbnw9sNXH3LYEL+vYt52iXJEmSNJBFCxJJ1k+ywcxl4CHA6cBRwH79zfYDjuwvHwXsneQmSW5DN6j6hL7702VJ7tnP1vTUiftIkiRJGsBidm26JXBEP1PrOsChVfWlJN8HDkuyP3Au8HiAqvpRksOAM4CrgedX1TX
"text/plain": [
"<Figure size 936x936 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
2022-04-13 15:08:29 +02:00
}
],
"source": [
2022-04-20 13:03:38 +02:00
"plot_bargraph_with_groupings(gdf_wims_exploded, 'Gebruiksdoel van het gebouw', 'Gemeente', 'Gebruiksdoelen van Stemlokalen', 'Gebruiksdoel', 'Hoeveelheid Stemlokalen')"
2022-04-13 15:08:29 +02:00
]
},
{
"cell_type": "code",
2022-04-20 13:03:38 +02:00
"execution_count": 44,
2022-04-13 15:08:29 +02:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" 0 1 2 3 4 \\\n",
"0 Lijstnummer Aanduiding Volgnummer Naam kandidaat Totaal \n",
"1 Gebiednummer NaN NaN NaN NaN \n",
"2 Postcode NaN NaN NaN NaN \n",
"3 NaN opgeroepenen NaN NaN 194113 \n",
"4 NaN geldige stempas NaN NaN 96830 \n",
".. ... ... ... ... ... \n",
"445 NaN NaN 5 Oetomo, A.D. 38 \n",
"446 NaN NaN 6 Smid, D. 25 \n",
"447 NaN NaN 7 van Welij, P.Z. 10 \n",
"448 16 Blanco (Dokter, T.) NaN NaN 100 \n",
"449 NaN NaN 1 Dokter, T. 100 \n",
"\n",
" 5 \\\n",
"0 GRID Grafisch Museum Groningen \n",
"1 101 \n",
"2 9712 JN \n",
"3 1396 \n",
"4 560 \n",
".. ... \n",
"445 0 \n",
"446 0 \n",
"447 0 \n",
"448 0 \n",
"449 0 \n",
"\n",
" 6 \\\n",
"0 Gemeente Groningen (locatie Kreupelstraat) \n",
"1 102 \n",
"2 9712 HW \n",
"3 1311 \n",
"4 469 \n",
".. ... \n",
"445 0 \n",
"446 0 \n",
"447 0 \n",
"448 0 \n",
"449 0 \n",
"\n",
" 7 8 9 \\\n",
"0 Gemeente Groningen (locatie Kreupelstraat) Der Aa-kerk Der Aa-kerk \n",
"1 103 104 105 \n",
"2 9712 HW 9711 JB 9711 JB \n",
"3 1311 1311 1311 \n",
"4 491 595 607 \n",
".. ... ... ... \n",
"445 0 0 0 \n",
"446 0 0 0 \n",
"447 0 0 0 \n",
"448 0 0 0 \n",
"449 0 0 0 \n",
"\n",
" ... 175 176 177 178 \\\n",
"0 ... MFC 't Vinkhuys De Fontein Trefpunt Beijum Wijkcentrum Het Dok \n",
"1 ... 827 828 829 830 \n",
"2 ... 9743 BJ 9741 EZ 9737 AB 9733 CA \n",
"3 ... 0 0 0 0 \n",
"4 ... 369 503 367 537 \n",
".. ... ... ... ... ... \n",
"445 ... 0 0 0 0 \n",
"446 ... 0 2 0 0 \n",
"447 ... 0 0 0 0 \n",
"448 ... 2 2 1 0 \n",
"449 ... 2 2 1 0 \n",
"\n",
" 179 180 \\\n",
"0 PKN Blister Ten Boer Buurtcentrum Stadspark \n",
"1 831 832 \n",
"2 9791 CP 9727 HW \n",
"3 0 0 \n",
"4 218 283 \n",
".. ... ... \n",
"445 0 0 \n",
"446 0 0 \n",
"447 0 0 \n",
"448 0 2 \n",
"449 0 2 \n",
"\n",
" 181 182 \\\n",
"0 Kerk van J.C. van de H. der Laatste Dagen Maranathakerk \n",
"1 833 834 \n",
"2 9728 AR 9721 PE \n",
"3 0 0 \n",
"4 302 473 \n",
".. ... ... \n",
"445 0 0 \n",
"446 3 0 \n",
"447 0 1 \n",
"448 0 0 \n",
"449 0 0 \n",
"\n",
" 183 184 \n",
"0 Tennispark Vorenkamp (GLTB) Gemeentehuis Haren \n",
"1 835 836 \n",
"2 9722 HJ 9751 AN \n",
"3 0 0 \n",
"4 495 815 \n",
".. ... ... \n",
"445 0 0 \n",
"446 0 0 \n",
"447 0 0 \n",
"448 0 0 \n",
"449 0 0 \n",
"\n",
"[450 rows x 185 columns]\n"
]
}
],
"source": [
"#de eerste vijf rijen zijn meta-data en kunnen we gerust weghalen voor nu \n",
"df_gr_gr = pd.read_csv(r'../data/stemmen/01_Groningen/osv4-3_telling_gr2022_groningen.csv', skiprows=5, header=None, delimiter=';')\n",
"print(df_gr_gr)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"De data is heel gecompliceerd, dus we moeten het bruikbaar maken in pandas. Met hoe de data eruit ziet in een CSV in libre office willen we een constructie maken van de verschillende onderdelen. We hebben de data van de stemlokalen apart al, die kunnen we dus negeren. We willen de data van de lijsten apart hebben. "
]
},
{
"cell_type": "code",
2022-04-20 13:03:38 +02:00
"execution_count": 45,
2022-04-13 15:08:29 +02:00
"metadata": {},
"outputs": [],
"source": [
"\n",
"#TODO:mobiele stemlokalen eruit filteren die NIET 0,0 zijn\n",
"#TODO:datastandaard duitse verkiezingen stemlokaalafstand opzoeken"
]
}
],
"metadata": {
"interpreter": {
"hash": "3d1ccb9efb47efc90847d5703ae4e5663eea6663e461c6dfd943b50a653adc65"
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"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",
2022-04-20 13:03:38 +02:00
"version": "3.9.11"
2022-04-13 15:08:29 +02:00
}
2022-03-29 17:09:40 +02:00
},
"nbformat": 4,
"nbformat_minor": 2
}