From 7a2edf1b84d57a3d61e1467f6b04f37163619d89 Mon Sep 17 00:00:00 2001
From: Lili Gasser <gasserli@ethz.ch>
Date: Wed, 5 Dec 2018 14:09:43 +0000
Subject: [PATCH] updated politicians notebook

---
 notebooks/browse_politicians.ipynb | 990 ++++++++++++++++++++++++++---
 1 file changed, 907 insertions(+), 83 deletions(-)

diff --git a/notebooks/browse_politicians.ipynb b/notebooks/browse_politicians.ipynb
index bd591c90..c4ae606a 100755
--- a/notebooks/browse_politicians.ipynb
+++ b/notebooks/browse_politicians.ipynb
@@ -4,7 +4,9 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "# Browse dictionary of politicians"
+    "# Browse politicians\n",
+    "In the folder data/politicians/lastnames, there is a pickle file for every year from 1890 until 2016. They contain the active politicians of that year.\n",
+    "\n"
    ]
   },
   {
@@ -18,107 +20,929 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 2,
+   "execution_count": 7,
    "metadata": {},
    "outputs": [],
    "source": [
-    "import os"
+    "year = 1899"
    ]
   },
   {
    "cell_type": "code",
-   "execution_count": 3,
+   "execution_count": 9,
    "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>type</th>\n",
+       "      <th>name_short</th>\n",
+       "      <th>name_correct</th>\n",
+       "      <th>uniqueIndex</th>\n",
+       "      <th>CantonName</th>\n",
+       "      <th>CantonAbbreviation</th>\n",
+       "      <th>Citizenship</th>\n",
+       "      <th>FirstName</th>\n",
+       "    </tr>\n",
+       "  </thead>\n",
+       "  <tbody>\n",
+       "    <tr>\n",
+       "      <th>0</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Abegg</td>\n",
+       "      <td>Abegg</td>\n",
+       "      <td>7</td>\n",
+       "      <td>Zürich</td>\n",
+       "      <td>ZH</td>\n",
+       "      <td>Küsnacht (ZH)</td>\n",
+       "      <td>Johann Jakob</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>1</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Ador</td>\n",
+       "      <td>Ador</td>\n",
+       "      <td>23</td>\n",
+       "      <td>Genf</td>\n",
+       "      <td>GE</td>\n",
+       "      <td>Vuiteboeuf (VD),Genf (GE)</td>\n",
+       "      <td>Gustave</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>2</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Ammann</td>\n",
+       "      <td>Ammann</td>\n",
+       "      <td>116</td>\n",
+       "      <td>Schaffhausen</td>\n",
+       "      <td>SH</td>\n",
+       "      <td>Schaffhausen (SH)</td>\n",
+       "      <td>P. Albert</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>3</th>\n",
+       "      <td>canton</td>\n",
+       "      <td>Amsler</td>\n",
+       "      <td>Amsler (Zürich)</td>\n",
+       "      <td>128</td>\n",
+       "      <td>Zürich</td>\n",
+       "      <td>ZH</td>\n",
+       "      <td>Meilen (ZH)</td>\n",
+       "      <td>Johann-Rudolf</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>4</th>\n",
+       "      <td>canton</td>\n",
+       "      <td>Amsler</td>\n",
+       "      <td>Amsler (Zürich)</td>\n",
+       "      <td>129</td>\n",
+       "      <td>Zürich</td>\n",
+       "      <td>ZH</td>\n",
+       "      <td>Aussersihl (ZH)</td>\n",
+       "      <td>Johann Jakob</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>5</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Bähler</td>\n",
+       "      <td>Bähler</td>\n",
+       "      <td>236</td>\n",
+       "      <td>Bern</td>\n",
+       "      <td>BE</td>\n",
+       "      <td>Längenbühl (BE)</td>\n",
+       "      <td>Traugott-Philipp Eduard</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>6</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Baldinger</td>\n",
+       "      <td>Baldinger</td>\n",
+       "      <td>238</td>\n",
+       "      <td>Aargau</td>\n",
+       "      <td>AG</td>\n",
+       "      <td>Baden (AG)</td>\n",
+       "      <td>Emil A.</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>7</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Bangerter</td>\n",
+       "      <td>Bangerter</td>\n",
+       "      <td>253</td>\n",
+       "      <td>Bern</td>\n",
+       "      <td>BE</td>\n",
+       "      <td>Lyss (BE)</td>\n",
+       "      <td>Gottfried</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>8</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Battaglini</td>\n",
+       "      <td>Battaglini</td>\n",
+       "      <td>279</td>\n",
+       "      <td>Tessin</td>\n",
+       "      <td>TI</td>\n",
+       "      <td>Cagiallo (TI)</td>\n",
+       "      <td>Antonio</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>9</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Benziger</td>\n",
+       "      <td>Benziger</td>\n",
+       "      <td>355</td>\n",
+       "      <td>Schwyz</td>\n",
+       "      <td>SZ</td>\n",
+       "      <td>Einsiedeln (SZ)</td>\n",
+       "      <td>Nikolaus</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>10</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Berchtold</td>\n",
+       "      <td>Berchtold</td>\n",
+       "      <td>364</td>\n",
+       "      <td>Zürich</td>\n",
+       "      <td>ZH</td>\n",
+       "      <td>Seegräben (ZH)</td>\n",
+       "      <td>Heinrich</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>11</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Berger</td>\n",
+       "      <td>Berger</td>\n",
+       "      <td>367</td>\n",
+       "      <td>Bern</td>\n",
+       "      <td>BE</td>\n",
+       "      <td>Langnau im Emmental (BE)</td>\n",
+       "      <td>Gottlieb</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>12</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Berlinger</td>\n",
+       "      <td>Berlinger</td>\n",
+       "      <td>376</td>\n",
+       "      <td>St. Gallen</td>\n",
+       "      <td>SG</td>\n",
+       "      <td>Ganterschwil (SG)</td>\n",
+       "      <td>Johann Georg</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>13</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Berthoud</td>\n",
+       "      <td>Berthoud</td>\n",
+       "      <td>401</td>\n",
+       "      <td>Neuenburg</td>\n",
+       "      <td>NE</td>\n",
+       "      <td>Boudevilliers (NE),Neuenburg (NE)</td>\n",
+       "      <td>Jean Ed.</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>14</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Bigler</td>\n",
+       "      <td>Bigler</td>\n",
+       "      <td>436</td>\n",
+       "      <td>Bern</td>\n",
+       "      <td>BE</td>\n",
+       "      <td>Worb (BE)</td>\n",
+       "      <td>Franz</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>15</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Bioley</td>\n",
+       "      <td>Bioley</td>\n",
+       "      <td>456</td>\n",
+       "      <td>Wallis</td>\n",
+       "      <td>VS</td>\n",
+       "      <td>St-Maurice (VS),Massongex (VS)</td>\n",
+       "      <td>Henri</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>16</th>\n",
+       "      <td>canton</td>\n",
+       "      <td>Blumer</td>\n",
+       "      <td>Blumer (Zürich)</td>\n",
+       "      <td>510</td>\n",
+       "      <td>Zürich</td>\n",
+       "      <td>ZH</td>\n",
+       "      <td>Embrach (ZH),Glarus (GL)</td>\n",
+       "      <td>Othmar</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>17</th>\n",
+       "      <td>canton</td>\n",
+       "      <td>Blumer</td>\n",
+       "      <td>Blumer (Glarus)</td>\n",
+       "      <td>513</td>\n",
+       "      <td>Glarus</td>\n",
+       "      <td>GL</td>\n",
+       "      <td>Schwanden (GL)</td>\n",
+       "      <td>Eduard</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>18</th>\n",
+       "      <td>canton</td>\n",
+       "      <td>Blumer</td>\n",
+       "      <td>Blumer (Glarus)</td>\n",
+       "      <td>517</td>\n",
+       "      <td>Glarus</td>\n",
+       "      <td>GL</td>\n",
+       "      <td>Engi (GL)</td>\n",
+       "      <td>Leonhard</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>19</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Boéchat</td>\n",
+       "      <td>Boéchat</td>\n",
+       "      <td>531</td>\n",
+       "      <td>Bern</td>\n",
+       "      <td>BE</td>\n",
+       "      <td>Miécourt (JU)</td>\n",
+       "      <td>Emile</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>20</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Boiceau</td>\n",
+       "      <td>Boiceau</td>\n",
+       "      <td>540</td>\n",
+       "      <td>Waadt</td>\n",
+       "      <td>VD</td>\n",
+       "      <td>Apples (VD)</td>\n",
+       "      <td>Charles M. S.</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>21</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Boinay</td>\n",
+       "      <td>Boinay</td>\n",
+       "      <td>541</td>\n",
+       "      <td>Bern</td>\n",
+       "      <td>BE</td>\n",
+       "      <td>Vendlincourt (JU)</td>\n",
+       "      <td>Joseph-Auguste</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>22</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Bolla</td>\n",
+       "      <td>Bolla</td>\n",
+       "      <td>545</td>\n",
+       "      <td>Tessin</td>\n",
+       "      <td>TI</td>\n",
+       "      <td>Castro (TI)</td>\n",
+       "      <td>Cesare</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>23</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Borella</td>\n",
+       "      <td>Borella</td>\n",
+       "      <td>597</td>\n",
+       "      <td>Tessin</td>\n",
+       "      <td>TI</td>\n",
+       "      <td>Mendrisio (TI)</td>\n",
+       "      <td>Achille</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>24</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Bossy</td>\n",
+       "      <td>Bossy</td>\n",
+       "      <td>639</td>\n",
+       "      <td>Freiburg</td>\n",
+       "      <td>FR</td>\n",
+       "      <td>Givisiez (FR),Avry-sur-Matran (FR)</td>\n",
+       "      <td>Alois</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>25</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Brenner</td>\n",
+       "      <td>Brenner</td>\n",
+       "      <td>681</td>\n",
+       "      <td>Basel-Stadt</td>\n",
+       "      <td>BS</td>\n",
+       "      <td>Basel (BS)</td>\n",
+       "      <td>Ernst</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>26</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Brosi</td>\n",
+       "      <td>Brosi</td>\n",
+       "      <td>729</td>\n",
+       "      <td>Solothurn</td>\n",
+       "      <td>SO</td>\n",
+       "      <td>Solothurn (SO),Mümliswil-Ramiswil (SO)</td>\n",
+       "      <td>Albert</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>27</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Büeler</td>\n",
+       "      <td>Büeler</td>\n",
+       "      <td>792</td>\n",
+       "      <td>Schwyz</td>\n",
+       "      <td>SZ</td>\n",
+       "      <td>Schwyz (SZ)</td>\n",
+       "      <td>Jos. Ferd. Anton</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>28</th>\n",
+       "      <td>canton</td>\n",
+       "      <td>Bühler</td>\n",
+       "      <td>Bühler (Graubünden)</td>\n",
+       "      <td>807</td>\n",
+       "      <td>Graubünden</td>\n",
+       "      <td>GR</td>\n",
+       "      <td>Davos (GR)</td>\n",
+       "      <td>Peter Theophil</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>29</th>\n",
+       "      <td>canton</td>\n",
+       "      <td>Bühler</td>\n",
+       "      <td>Bühler (Bern)</td>\n",
+       "      <td>810</td>\n",
+       "      <td>Bern</td>\n",
+       "      <td>BE</td>\n",
+       "      <td>Aeschi b. Spiez (BE)</td>\n",
+       "      <td>Arnold Gottlieb</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",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>207</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Thélin</td>\n",
+       "      <td>Thélin</td>\n",
+       "      <td>5216</td>\n",
+       "      <td>Waadt</td>\n",
+       "      <td>VD</td>\n",
+       "      <td>Bioley-Orjulaz (VD)</td>\n",
+       "      <td>Adrien F.-H.</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>208</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Theraulaz</td>\n",
+       "      <td>Theraulaz</td>\n",
+       "      <td>5223</td>\n",
+       "      <td>Freiburg</td>\n",
+       "      <td>FR</td>\n",
+       "      <td>Freiburg (FR)</td>\n",
+       "      <td>Alphonse</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>209</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Tissot</td>\n",
+       "      <td>Tissot</td>\n",
+       "      <td>5242</td>\n",
+       "      <td>Neuenburg</td>\n",
+       "      <td>NE</td>\n",
+       "      <td>Le Locle (NE),La Ferrière (BE)</td>\n",
+       "      <td>Charles Emile</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>210</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Tobler</td>\n",
+       "      <td>Tobler</td>\n",
+       "      <td>5243</td>\n",
+       "      <td>St. Gallen</td>\n",
+       "      <td>SG</td>\n",
+       "      <td>Thal (SG)</td>\n",
+       "      <td>Christoph</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>211</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Triquet</td>\n",
+       "      <td>Triquet</td>\n",
+       "      <td>5273</td>\n",
+       "      <td>Genf</td>\n",
+       "      <td>GE</td>\n",
+       "      <td>Carouge (GE)</td>\n",
+       "      <td>Alexandre</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>212</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Ursprung</td>\n",
+       "      <td>Ursprung</td>\n",
+       "      <td>5337</td>\n",
+       "      <td>Aargau</td>\n",
+       "      <td>AG</td>\n",
+       "      <td>Ueken (AG),Zurzach (AG)</td>\n",
+       "      <td>Albert</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>213</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Vigier</td>\n",
+       "      <td>Vigier</td>\n",
+       "      <td>5390</td>\n",
+       "      <td>Solothurn</td>\n",
+       "      <td>SO</td>\n",
+       "      <td>Solothurn (SO)</td>\n",
+       "      <td>Wilhelm</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>214</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Vincent</td>\n",
+       "      <td>Vincent</td>\n",
+       "      <td>5400</td>\n",
+       "      <td>Genf</td>\n",
+       "      <td>GE</td>\n",
+       "      <td>Genf (GE)</td>\n",
+       "      <td>Alfred-L.</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>215</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Vital</td>\n",
+       "      <td>Vital</td>\n",
+       "      <td>5409</td>\n",
+       "      <td>Graubünden</td>\n",
+       "      <td>GR</td>\n",
+       "      <td>Sent (GR),Fetan (GR)</td>\n",
+       "      <td>Andreas</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>216</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Vogelsanger</td>\n",
+       "      <td>Vogelsanger</td>\n",
+       "      <td>5417</td>\n",
+       "      <td>Zürich</td>\n",
+       "      <td>ZH</td>\n",
+       "      <td>Zürich-Oberstrass (ZH),Beggingen (SH)</td>\n",
+       "      <td>Jakob J.</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>217</th>\n",
+       "      <td>comp</td>\n",
+       "      <td>Albertini</td>\n",
+       "      <td>von Albertini</td>\n",
+       "      <td>5433</td>\n",
+       "      <td>Graubünden</td>\n",
+       "      <td>GR</td>\n",
+       "      <td>Ponte-Campovasto (GR)</td>\n",
+       "      <td>Thomas</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>218</th>\n",
+       "      <td>comp</td>\n",
+       "      <td>Arx</td>\n",
+       "      <td>von Arx</td>\n",
+       "      <td>5438</td>\n",
+       "      <td>Solothurn</td>\n",
+       "      <td>SO</td>\n",
+       "      <td>Olten (SO)</td>\n",
+       "      <td>Casimir</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>219</th>\n",
+       "      <td>comp</td>\n",
+       "      <td>Planta</td>\n",
+       "      <td>von Planta</td>\n",
+       "      <td>5477</td>\n",
+       "      <td>Graubünden</td>\n",
+       "      <td>GR</td>\n",
+       "      <td>Tamins (GR),Chur (GR),Sameden (GR)</td>\n",
+       "      <td>Alfred</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>220</th>\n",
+       "      <td>comp</td>\n",
+       "      <td>Schumacher</td>\n",
+       "      <td>von Schumacher</td>\n",
+       "      <td>5495</td>\n",
+       "      <td>Luzern</td>\n",
+       "      <td>LU</td>\n",
+       "      <td>Luzern (LU)</td>\n",
+       "      <td>Edmund</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>221</th>\n",
+       "      <td>comp</td>\n",
+       "      <td>Steiger</td>\n",
+       "      <td>von Steiger</td>\n",
+       "      <td>5507</td>\n",
+       "      <td>Bern</td>\n",
+       "      <td>BE</td>\n",
+       "      <td>Bern (BE)</td>\n",
+       "      <td>K. Fr. Edmund</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>222</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Wild</td>\n",
+       "      <td>Wild</td>\n",
+       "      <td>5718</td>\n",
+       "      <td>St. Gallen</td>\n",
+       "      <td>SG</td>\n",
+       "      <td>St. Gallen (SG)</td>\n",
+       "      <td>Karl Emil</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>223</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Will</td>\n",
+       "      <td>Will</td>\n",
+       "      <td>5725</td>\n",
+       "      <td>Bern</td>\n",
+       "      <td>BE</td>\n",
+       "      <td>Ste-Croix (VD),Bern (BE)</td>\n",
+       "      <td>Eduard</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>224</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Winiger</td>\n",
+       "      <td>Winiger</td>\n",
+       "      <td>5729</td>\n",
+       "      <td>Luzern</td>\n",
+       "      <td>LU</td>\n",
+       "      <td>Ermensee (LU)</td>\n",
+       "      <td>Josef</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>225</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Wirz</td>\n",
+       "      <td>Wirz</td>\n",
+       "      <td>5754</td>\n",
+       "      <td>Obwalden</td>\n",
+       "      <td>OW</td>\n",
+       "      <td>Sarnen (OW)</td>\n",
+       "      <td>Theodor</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>226</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Wullschleger</td>\n",
+       "      <td>Wullschleger</td>\n",
+       "      <td>5768</td>\n",
+       "      <td>Basel-Stadt</td>\n",
+       "      <td>BS</td>\n",
+       "      <td>Basel (BS),Vordemwald (AG)</td>\n",
+       "      <td>Eugen</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>227</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Wunderli</td>\n",
+       "      <td>Wunderli</td>\n",
+       "      <td>5773</td>\n",
+       "      <td>Zürich</td>\n",
+       "      <td>ZH</td>\n",
+       "      <td>Meilen (ZH)</td>\n",
+       "      <td>Hans</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>228</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Wyrsch</td>\n",
+       "      <td>Wyrsch</td>\n",
+       "      <td>5784</td>\n",
+       "      <td>Nidwalden</td>\n",
+       "      <td>NW</td>\n",
+       "      <td>Buochs (NW)</td>\n",
+       "      <td>Jakob Konst.</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>229</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Wyss</td>\n",
+       "      <td>Wyss</td>\n",
+       "      <td>5788</td>\n",
+       "      <td>Bern</td>\n",
+       "      <td>BE</td>\n",
+       "      <td>Bern (BE)</td>\n",
+       "      <td>S. J. Ernst</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>230</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Zemp</td>\n",
+       "      <td>Zemp</td>\n",
+       "      <td>5832</td>\n",
+       "      <td>Luzern</td>\n",
+       "      <td>LU</td>\n",
+       "      <td>Entlebuch (LU)</td>\n",
+       "      <td>Joseph</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>231</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Zimmermann</td>\n",
+       "      <td>Zimmermann</td>\n",
+       "      <td>5861</td>\n",
+       "      <td>Bern</td>\n",
+       "      <td>BE</td>\n",
+       "      <td>Lyss (BE)</td>\n",
+       "      <td>Johann</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>232</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Zschokke</td>\n",
+       "      <td>Zschokke</td>\n",
+       "      <td>5878</td>\n",
+       "      <td>Aargau</td>\n",
+       "      <td>AG</td>\n",
+       "      <td>Aarau (AG),Malans (GR)</td>\n",
+       "      <td>F. V. Konradin</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>233</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Zumstein</td>\n",
+       "      <td>Zumstein</td>\n",
+       "      <td>5889</td>\n",
+       "      <td>Bern</td>\n",
+       "      <td>BE</td>\n",
+       "      <td>Seeberg (BE)</td>\n",
+       "      <td>Fritz</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>234</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Zurbuchen</td>\n",
+       "      <td>Zurbuchen</td>\n",
+       "      <td>5897</td>\n",
+       "      <td>Bern</td>\n",
+       "      <td>BE</td>\n",
+       "      <td>Ringgenberg (BE)</td>\n",
+       "      <td>Mathäus</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>235</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Zürcher</td>\n",
+       "      <td>Zürcher</td>\n",
+       "      <td>5900</td>\n",
+       "      <td>Zürich</td>\n",
+       "      <td>ZH</td>\n",
+       "      <td>Grub (AR)</td>\n",
+       "      <td>Emil J. J.</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>236</th>\n",
+       "      <td>simple</td>\n",
+       "      <td>Zweifel</td>\n",
+       "      <td>Zweifel</td>\n",
+       "      <td>5913</td>\n",
+       "      <td>Glarus</td>\n",
+       "      <td>GL</td>\n",
+       "      <td>Linthal (GL)</td>\n",
+       "      <td>Peter</td>\n",
+       "    </tr>\n",
+       "  </tbody>\n",
+       "</table>\n",
+       "<p>237 rows × 8 columns</p>\n",
+       "</div>"
+      ],
       "text/plain": [
-       "'/home/jovyan/democrasci/notebooks'"
+       "       type    name_short         name_correct  uniqueIndex    CantonName  \\\n",
+       "0    simple         Abegg                Abegg            7        Zürich   \n",
+       "1    simple          Ador                 Ador           23          Genf   \n",
+       "2    simple        Ammann               Ammann          116  Schaffhausen   \n",
+       "3    canton        Amsler      Amsler (Zürich)          128        Zürich   \n",
+       "4    canton        Amsler      Amsler (Zürich)          129        Zürich   \n",
+       "5    simple        Bähler               Bähler          236          Bern   \n",
+       "6    simple     Baldinger            Baldinger          238        Aargau   \n",
+       "7    simple     Bangerter            Bangerter          253          Bern   \n",
+       "8    simple    Battaglini           Battaglini          279        Tessin   \n",
+       "9    simple      Benziger             Benziger          355        Schwyz   \n",
+       "10   simple     Berchtold            Berchtold          364        Zürich   \n",
+       "11   simple        Berger               Berger          367          Bern   \n",
+       "12   simple     Berlinger            Berlinger          376    St. Gallen   \n",
+       "13   simple      Berthoud             Berthoud          401     Neuenburg   \n",
+       "14   simple        Bigler               Bigler          436          Bern   \n",
+       "15   simple        Bioley               Bioley          456        Wallis   \n",
+       "16   canton        Blumer      Blumer (Zürich)          510        Zürich   \n",
+       "17   canton        Blumer      Blumer (Glarus)          513        Glarus   \n",
+       "18   canton        Blumer      Blumer (Glarus)          517        Glarus   \n",
+       "19   simple       Boéchat              Boéchat          531          Bern   \n",
+       "20   simple       Boiceau              Boiceau          540         Waadt   \n",
+       "21   simple        Boinay               Boinay          541          Bern   \n",
+       "22   simple         Bolla                Bolla          545        Tessin   \n",
+       "23   simple       Borella              Borella          597        Tessin   \n",
+       "24   simple         Bossy                Bossy          639      Freiburg   \n",
+       "25   simple       Brenner              Brenner          681   Basel-Stadt   \n",
+       "26   simple         Brosi                Brosi          729     Solothurn   \n",
+       "27   simple        Büeler               Büeler          792        Schwyz   \n",
+       "28   canton        Bühler  Bühler (Graubünden)          807    Graubünden   \n",
+       "29   canton        Bühler        Bühler (Bern)          810          Bern   \n",
+       "..      ...           ...                  ...          ...           ...   \n",
+       "207  simple        Thélin               Thélin         5216         Waadt   \n",
+       "208  simple     Theraulaz            Theraulaz         5223      Freiburg   \n",
+       "209  simple        Tissot               Tissot         5242     Neuenburg   \n",
+       "210  simple        Tobler               Tobler         5243    St. Gallen   \n",
+       "211  simple       Triquet              Triquet         5273          Genf   \n",
+       "212  simple      Ursprung             Ursprung         5337        Aargau   \n",
+       "213  simple        Vigier               Vigier         5390     Solothurn   \n",
+       "214  simple       Vincent              Vincent         5400          Genf   \n",
+       "215  simple         Vital                Vital         5409    Graubünden   \n",
+       "216  simple   Vogelsanger          Vogelsanger         5417        Zürich   \n",
+       "217    comp     Albertini        von Albertini         5433    Graubünden   \n",
+       "218    comp           Arx              von Arx         5438     Solothurn   \n",
+       "219    comp        Planta           von Planta         5477    Graubünden   \n",
+       "220    comp    Schumacher       von Schumacher         5495        Luzern   \n",
+       "221    comp       Steiger          von Steiger         5507          Bern   \n",
+       "222  simple          Wild                 Wild         5718    St. Gallen   \n",
+       "223  simple          Will                 Will         5725          Bern   \n",
+       "224  simple       Winiger              Winiger         5729        Luzern   \n",
+       "225  simple          Wirz                 Wirz         5754      Obwalden   \n",
+       "226  simple  Wullschleger         Wullschleger         5768   Basel-Stadt   \n",
+       "227  simple      Wunderli             Wunderli         5773        Zürich   \n",
+       "228  simple        Wyrsch               Wyrsch         5784     Nidwalden   \n",
+       "229  simple          Wyss                 Wyss         5788          Bern   \n",
+       "230  simple          Zemp                 Zemp         5832        Luzern   \n",
+       "231  simple    Zimmermann           Zimmermann         5861          Bern   \n",
+       "232  simple      Zschokke             Zschokke         5878        Aargau   \n",
+       "233  simple      Zumstein             Zumstein         5889          Bern   \n",
+       "234  simple     Zurbuchen            Zurbuchen         5897          Bern   \n",
+       "235  simple       Zürcher              Zürcher         5900        Zürich   \n",
+       "236  simple       Zweifel              Zweifel         5913        Glarus   \n",
+       "\n",
+       "    CantonAbbreviation                             Citizenship  \\\n",
+       "0                   ZH                           Küsnacht (ZH)   \n",
+       "1                   GE               Vuiteboeuf (VD),Genf (GE)   \n",
+       "2                   SH                       Schaffhausen (SH)   \n",
+       "3                   ZH                             Meilen (ZH)   \n",
+       "4                   ZH                         Aussersihl (ZH)   \n",
+       "5                   BE                         Längenbühl (BE)   \n",
+       "6                   AG                              Baden (AG)   \n",
+       "7                   BE                               Lyss (BE)   \n",
+       "8                   TI                           Cagiallo (TI)   \n",
+       "9                   SZ                         Einsiedeln (SZ)   \n",
+       "10                  ZH                          Seegräben (ZH)   \n",
+       "11                  BE                Langnau im Emmental (BE)   \n",
+       "12                  SG                       Ganterschwil (SG)   \n",
+       "13                  NE       Boudevilliers (NE),Neuenburg (NE)   \n",
+       "14                  BE                               Worb (BE)   \n",
+       "15                  VS          St-Maurice (VS),Massongex (VS)   \n",
+       "16                  ZH                Embrach (ZH),Glarus (GL)   \n",
+       "17                  GL                          Schwanden (GL)   \n",
+       "18                  GL                               Engi (GL)   \n",
+       "19                  BE                           Miécourt (JU)   \n",
+       "20                  VD                             Apples (VD)   \n",
+       "21                  BE                       Vendlincourt (JU)   \n",
+       "22                  TI                             Castro (TI)   \n",
+       "23                  TI                          Mendrisio (TI)   \n",
+       "24                  FR      Givisiez (FR),Avry-sur-Matran (FR)   \n",
+       "25                  BS                              Basel (BS)   \n",
+       "26                  SO  Solothurn (SO),Mümliswil-Ramiswil (SO)   \n",
+       "27                  SZ                             Schwyz (SZ)   \n",
+       "28                  GR                              Davos (GR)   \n",
+       "29                  BE                    Aeschi b. Spiez (BE)   \n",
+       "..                 ...                                     ...   \n",
+       "207                 VD                     Bioley-Orjulaz (VD)   \n",
+       "208                 FR                           Freiburg (FR)   \n",
+       "209                 NE          Le Locle (NE),La Ferrière (BE)   \n",
+       "210                 SG                               Thal (SG)   \n",
+       "211                 GE                            Carouge (GE)   \n",
+       "212                 AG                 Ueken (AG),Zurzach (AG)   \n",
+       "213                 SO                          Solothurn (SO)   \n",
+       "214                 GE                               Genf (GE)   \n",
+       "215                 GR                    Sent (GR),Fetan (GR)   \n",
+       "216                 ZH   Zürich-Oberstrass (ZH),Beggingen (SH)   \n",
+       "217                 GR                   Ponte-Campovasto (GR)   \n",
+       "218                 SO                              Olten (SO)   \n",
+       "219                 GR      Tamins (GR),Chur (GR),Sameden (GR)   \n",
+       "220                 LU                             Luzern (LU)   \n",
+       "221                 BE                               Bern (BE)   \n",
+       "222                 SG                         St. Gallen (SG)   \n",
+       "223                 BE                Ste-Croix (VD),Bern (BE)   \n",
+       "224                 LU                           Ermensee (LU)   \n",
+       "225                 OW                             Sarnen (OW)   \n",
+       "226                 BS              Basel (BS),Vordemwald (AG)   \n",
+       "227                 ZH                             Meilen (ZH)   \n",
+       "228                 NW                             Buochs (NW)   \n",
+       "229                 BE                               Bern (BE)   \n",
+       "230                 LU                          Entlebuch (LU)   \n",
+       "231                 BE                               Lyss (BE)   \n",
+       "232                 AG                  Aarau (AG),Malans (GR)   \n",
+       "233                 BE                            Seeberg (BE)   \n",
+       "234                 BE                        Ringgenberg (BE)   \n",
+       "235                 ZH                               Grub (AR)   \n",
+       "236                 GL                            Linthal (GL)   \n",
+       "\n",
+       "                   FirstName  \n",
+       "0               Johann Jakob  \n",
+       "1                    Gustave  \n",
+       "2                  P. Albert  \n",
+       "3              Johann-Rudolf  \n",
+       "4               Johann Jakob  \n",
+       "5    Traugott-Philipp Eduard  \n",
+       "6                    Emil A.  \n",
+       "7                  Gottfried  \n",
+       "8                    Antonio  \n",
+       "9                   Nikolaus  \n",
+       "10                  Heinrich  \n",
+       "11                  Gottlieb  \n",
+       "12              Johann Georg  \n",
+       "13                  Jean Ed.  \n",
+       "14                     Franz  \n",
+       "15                     Henri  \n",
+       "16                    Othmar  \n",
+       "17                    Eduard  \n",
+       "18                  Leonhard  \n",
+       "19                     Emile  \n",
+       "20             Charles M. S.  \n",
+       "21            Joseph-Auguste  \n",
+       "22                    Cesare  \n",
+       "23                   Achille  \n",
+       "24                     Alois  \n",
+       "25                     Ernst  \n",
+       "26                    Albert  \n",
+       "27          Jos. Ferd. Anton  \n",
+       "28            Peter Theophil  \n",
+       "29           Arnold Gottlieb  \n",
+       "..                       ...  \n",
+       "207             Adrien F.-H.  \n",
+       "208                 Alphonse  \n",
+       "209            Charles Emile  \n",
+       "210                Christoph  \n",
+       "211                Alexandre  \n",
+       "212                   Albert  \n",
+       "213                  Wilhelm  \n",
+       "214                Alfred-L.  \n",
+       "215                  Andreas  \n",
+       "216                 Jakob J.  \n",
+       "217                   Thomas  \n",
+       "218                  Casimir  \n",
+       "219                   Alfred  \n",
+       "220                   Edmund  \n",
+       "221            K. Fr. Edmund  \n",
+       "222                Karl Emil  \n",
+       "223                   Eduard  \n",
+       "224                    Josef  \n",
+       "225                  Theodor  \n",
+       "226                    Eugen  \n",
+       "227                     Hans  \n",
+       "228             Jakob Konst.  \n",
+       "229              S. J. Ernst  \n",
+       "230                   Joseph  \n",
+       "231                   Johann  \n",
+       "232           F. V. Konradin  \n",
+       "233                    Fritz  \n",
+       "234                  Mathäus  \n",
+       "235               Emil J. J.  \n",
+       "236                    Peter  \n",
+       "\n",
+       "[237 rows x 8 columns]"
       ]
      },
-     "execution_count": 3,
+     "execution_count": 9,
      "metadata": {},
      "output_type": "execute_result"
     }
    ],
    "source": [
-    "os.getcwd()"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": 17,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "with open(\"../data/politicians/MPs_lastnames_test.pickle\", \"rb\") as f:\n",
-    "    foo = pickle.load(f)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": 18,
-   "metadata": {},
-   "outputs": [
-    {
-     "data": {
-      "text/plain": [
-       "dict"
-      ]
-     },
-     "execution_count": 18,
-     "metadata": {},
-     "output_type": "execute_result"
-    }
-   ],
-   "source": [
-    "type(foo)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": 19,
-   "metadata": {},
-   "outputs": [
-    {
-     "data": {
-      "text/plain": [
-       "dict_keys([1891, 1892, 1893])"
-      ]
-     },
-     "execution_count": 19,
-     "metadata": {},
-     "output_type": "execute_result"
-    }
-   ],
-   "source": [
-    "foo.keys()"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": 20,
-   "metadata": {},
-   "outputs": [
-    {
-     "name": "stdout",
-     "output_type": "stream",
-     "text": [
-      "[('Abegg', 'Abegg', 7, 'Zürich', 'ZH', 'Küsnacht (ZH)', 'Johann Jakob'), ('Ador', 'Ador', 23, 'Genf', 'GE', 'Vuiteboeuf (VD),Genf (GE)', 'Gustave'), ('Aeby', 'Aeby', 36, 'Freiburg', 'FR', 'Freiburg (FR)', 'Paul'), ('Amstad', 'Amstad', 131, 'Nidwalden', 'NW', 'Beckenried (NW)', 'Joh. Josef M.'), ('Bachmann', 'Bachmann', 219, 'Thurgau', 'TG', 'Stettfurt (TG)', 'Jakob H.'), ('Bähler', 'Bähler', 236, 'Bern', 'BE', 'Längenbühl (BE)', 'Traugott-Philipp Eduard'), ('Baldinger', 'Baldinger', 238, 'Aargau', 'AG', 'Baden (AG)', 'Emil A.'), ('Balli', 'Balli', 242, 'Tessin', 'TI', 'Cavergno (TI)', 'Francesco'), ('Bangerter', 'Bangerter', 253, 'Bern', 'BE', 'Lyss (BE)', 'Gottfried'), ('Baud', 'Baud', 280, 'Waadt', 'VD', 'Apples (VD)', 'Charles-H.-A.')]\n",
-      "7\n",
-      "[('Cramer', 'Cramer', 1150, 'Zürich', 'ZH', 'Zürich (ZH),Volken (ZH)', 'Konrad H.'), ('Frey', 'Cramer', 1150, 'Zürich', 'ZH', 'Zürich (ZH),Volken (ZH)', 'Konrad H.'), ('Cramer-Frey', 'Cramer', 1150, 'Zürich', 'ZH', 'Zürich (ZH),Volken (ZH)', 'Konrad H.'), ('CramerFrey', 'Cramer', 1150, 'Zürich', 'ZH', 'Zürich (ZH),Volken (ZH)', 'Konrad H.'), ('Jordan', 'Jordan', 2792, 'Waadt', 'VD', 'Granges-près-Marnand (VD)', 'Adolphe'), ('Martin', 'Jordan', 2792, 'Waadt', 'VD', 'Granges-près-Marnand (VD)', 'Adolphe'), ('Jordan-Martin', 'Jordan', 2792, 'Waadt', 'VD', 'Granges-près-Marnand (VD)', 'Adolphe'), ('JordanMartin', 'Jordan', 2792, 'Waadt', 'VD', 'Granges-près-Marnand (VD)', 'Adolphe'), ('Scherrer', 'Scherrer-Füllemann', 4582, 'St. Gallen', 'SG', 'Kirchberg (SG)', 'Joseph Anton'), ('Füllemann', 'Scherrer-Füllemann', 4582, 'St. Gallen', 'SG', 'Kirchberg (SG)', 'Joseph Anton')]\n",
-      "7\n",
-      "[('Chastonay', 'de Chastonay', 1211, 'Wallis', 'VS', 'Siders (VS)', 'Victor'), ('Schaller', 'de Schaller', 1252, 'Freiburg', 'FR', 'Corminboeuf (FR),Freiburg (FR)', 'Henri Gaspard'), ('Stoppani', 'de Stoppani', 1260, 'Tessin', 'TI', 'Ponte Tresa (TI)', 'Leone'), ('Werra', 'de Werra', 1266, 'Wallis', 'VS', 'St-Maurice (VS)', 'Charles'), ('Wuilleret', 'de Wuilleret', 1270, 'Freiburg', 'FR', 'Romont (FR),Freiburg (FR)', 'Louis'), ('Arx', 'von Arx', 5438, 'Solothurn', 'SO', 'Olten (SO)', 'Casimir'), ('Matt', 'von Matt', 5464, 'Nidwalden', 'NW', 'Stans (NW)', 'Hans sen.'), ('Roten', 'von Roten', 5482, 'Wallis', 'VS', 'Raron (VS)', 'Hans Anton'), ('Steiger', 'von Steiger', 5507, 'Bern', 'BE', 'Bern (BE)', 'K. Fr. Edmund')]\n",
-      "7\n",
-      "[('Blumer', 'Blumer (Zürich)', 510, 'Zürich', 'ZH', 'Embrach (ZH),Glarus (GL)', 'Othmar'), ('Blumer', 'Blumer (St. Gallen)', 516, 'St. Gallen', 'SG', 'Glarus (GL)', 'Johannes'), ('Bühler', 'Bühler (Graubünden)', 807, 'Graubünden', 'GR', 'Davos (GR)', 'Peter Theophil'), ('Bühler', 'Bühler (Bern)', 810, 'Bern', 'BE', 'Aeschi b. Spiez (BE)', 'Arnold Gottlieb'), ('Bühler', 'Bühler (Zürich)', 812, 'Zürich', 'ZH', 'Hombrechtikon (ZH)', 'Joh. Heinrich'), ('Dufour', 'Dufour (Genf)', 1420, 'Genf', 'GE', 'Genf (GE)', 'Jean-Etienne'), ('Dufour', 'Dufour (Bern)', 1421, 'Bern', 'BE', 'Genf (GE)', 'Guillaume-Henri'), ('Good', 'Good (St. Gallen)', 2101, 'St. Gallen', 'SG', 'Mels (SG)', 'Wilhelm'), ('Good', 'Good (St. Gallen)', 2102, 'St. Gallen', 'SG', 'Mels (SG)', 'Karl Friedrich'), ('Hauser', 'Hauser (Bern)', 2378, 'Bern', 'BE', 'Wädenswil (ZH),Rüti b. Riggisberg (BE)', 'Johann Jakob')]\n",
-      "7\n"
-     ]
-    }
-   ],
-   "source": [
-    "for elm in foo[1891]:\n",
-    "    print(elm[:10])\n",
-    "    print(len(elm[0]))"
+    "with open(\"../data/politicians/lastnames/{}_lastnames.pickle\".format(str(year)), \"rb\") as f:\n",
+    "    df_lastnames = pickle.load(f)\n",
+    "    \n",
+    "df_lastnames"
    ]
   }
  ],
-- 
GitLab