diff --git a/notebooks/debugging.ipynb b/notebooks/debugging.ipynb
new file mode 100644
index 0000000..9532296
--- /dev/null
+++ b/notebooks/debugging.ipynb
@@ -0,0 +1,1227 @@
+{
+ "cells": [
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import pickle\n",
+ "import numpy as np\n",
+ "import pandas as pd"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "def pkload(path):\n",
+ " with open(path, 'rb') as f:\n",
+ " obj = pickle.load(f)\n",
+ " return obj"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Searching for journeys from Uster, Gschwader (stop 8588052) to Buchs ZH, Furttalstrasse (stop 8595356) with arrival at 17:30 leads to a footpath of over 3.2km + in reality, while the algorithm prints this:\n",
+ "\n",
+ "\" Walk 2.1 minutes from Birmensdorf ZH (stop 8502221)\n",
+ " to Dällikon, Industrie (stop 8576276)\""
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 54,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "
\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " index | \n",
+ " route_id | \n",
+ " stop_id_general | \n",
+ " trip_id | \n",
+ " stop_id | \n",
+ " arrival_time | \n",
+ " departure_time | \n",
+ " stop_sequence | \n",
+ " stop_name | \n",
+ " stop_lat | \n",
+ " stop_lon | \n",
+ " trip_headsign | \n",
+ " trip_short_name | \n",
+ " direction_id | \n",
+ " departure_first_stop | \n",
+ " route_int | \n",
+ " stop_count | \n",
+ " stop_int | \n",
+ " route_desc | \n",
+ " monotonically_increasing_id | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 27708 | \n",
+ " 197013 | \n",
+ " 26-5-A-j19-1 | \n",
+ " 8502221 | \n",
+ " 114.TA.26-5-A-j19-1.37.R | \n",
+ " 8502221:0:2 | \n",
+ " 2020-05-24 19:35:00 | \n",
+ " 2020-05-24 19:35:00 | \n",
+ " 9 | \n",
+ " Birmensdorf ZH | \n",
+ " 47.357496 | \n",
+ " 8.437543 | \n",
+ " Pfäffikon SZ | \n",
+ " 18575 | \n",
+ " 1 | \n",
+ " 19:22:00 | \n",
+ " 149 | \n",
+ " 10 | \n",
+ " 276 | \n",
+ " S-Bahn | \n",
+ " 180388626589 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " index route_id stop_id_general trip_id \\\n",
+ "27708 197013 26-5-A-j19-1 8502221 114.TA.26-5-A-j19-1.37.R \n",
+ "\n",
+ " stop_id arrival_time departure_time stop_sequence \\\n",
+ "27708 8502221:0:2 2020-05-24 19:35:00 2020-05-24 19:35:00 9 \n",
+ "\n",
+ " stop_name stop_lat stop_lon trip_headsign trip_short_name \\\n",
+ "27708 Birmensdorf ZH 47.357496 8.437543 Pfäffikon SZ 18575 \n",
+ "\n",
+ " direction_id departure_first_stop route_int stop_count stop_int \\\n",
+ "27708 1 19:22:00 149 10 276 \n",
+ "\n",
+ " route_desc monotonically_increasing_id \n",
+ "27708 S-Bahn 180388626589 "
+ ]
+ },
+ "execution_count": 54,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# Birmensdorf ZH\n",
+ "stop_times = pkload(\"../data/stop_times_df_cyril.pkl\")\n",
+ "stop_times[stop_times['stop_id_general']==8502221].head(1)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 55,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " index | \n",
+ " route_id | \n",
+ " stop_id_general | \n",
+ " trip_id | \n",
+ " stop_id | \n",
+ " arrival_time | \n",
+ " departure_time | \n",
+ " stop_sequence | \n",
+ " stop_name | \n",
+ " stop_lat | \n",
+ " stop_lon | \n",
+ " trip_headsign | \n",
+ " trip_short_name | \n",
+ " direction_id | \n",
+ " departure_first_stop | \n",
+ " route_int | \n",
+ " stop_count | \n",
+ " stop_int | \n",
+ " route_desc | \n",
+ " monotonically_increasing_id | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 1935 | \n",
+ " 222352 | \n",
+ " 26-449-j19-1 | \n",
+ " 8576276 | \n",
+ " 17.TA.26-449-j19-1.1.H | \n",
+ " 8576276 | \n",
+ " NaT | \n",
+ " 2020-05-24 07:00:00 | \n",
+ " 2 | \n",
+ " Dällikon, Industrie | \n",
+ " 47.444737 | \n",
+ " 8.438783 | \n",
+ " Buchs-Dällikon, Bahnhof | \n",
+ " 4747 | \n",
+ " 0 | \n",
+ " 07:00:00 | \n",
+ " 19 | \n",
+ " 3 | \n",
+ " 474 | \n",
+ " Bus | \n",
+ " 8589935205 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " index route_id stop_id_general trip_id stop_id \\\n",
+ "1935 222352 26-449-j19-1 8576276 17.TA.26-449-j19-1.1.H 8576276 \n",
+ "\n",
+ " arrival_time departure_time stop_sequence stop_name \\\n",
+ "1935 NaT 2020-05-24 07:00:00 2 Dällikon, Industrie \n",
+ "\n",
+ " stop_lat stop_lon trip_headsign trip_short_name \\\n",
+ "1935 47.444737 8.438783 Buchs-Dällikon, Bahnhof 4747 \n",
+ "\n",
+ " direction_id departure_first_stop route_int stop_count stop_int \\\n",
+ "1935 0 07:00:00 19 3 474 \n",
+ "\n",
+ " route_desc monotonically_increasing_id \n",
+ "1935 Bus 8589935205 "
+ ]
+ },
+ "execution_count": 55,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# Dallikon Industrie\n",
+ "stop_times[stop_times['stop_id_general']==8576276].head(1)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "A google maps footpaths using GPS coordinates yields a walk of 14.1 km. Is there a footpath defined between those two stops in transfers ?"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 56,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "transfers = pkload(\"../data/transfer_df_cyril.pkl\")"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 58,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " index | \n",
+ " stop_id_general | \n",
+ " stop_int | \n",
+ " stop_lat_first | \n",
+ " stop_lon_first | \n",
+ " stop_name_first | \n",
+ " stop_id_general_2 | \n",
+ " stop_int_2 | \n",
+ " stop_lat_first_2 | \n",
+ " stop_lon_first_2 | \n",
+ " stop_name_first_2 | \n",
+ " distance | \n",
+ " walking_time | \n",
+ " monotonically_increasing_id | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 1300 | \n",
+ " 3887 | \n",
+ " 8502221 | \n",
+ " 276 | \n",
+ " 47.357557 | \n",
+ " 8.437543 | \n",
+ " Birmensdorf ZH | \n",
+ " 8573718 | \n",
+ " 473 | \n",
+ " 47.357125 | \n",
+ " 8.438801 | \n",
+ " Birmensdorf ZH, Bahnhof | \n",
+ " 0.106219 | \n",
+ " 127 | \n",
+ " 352187318287 | \n",
+ "
\n",
+ " \n",
+ " 1301 | \n",
+ " 3888 | \n",
+ " 8502221 | \n",
+ " 276 | \n",
+ " 47.357557 | \n",
+ " 8.437543 | \n",
+ " Birmensdorf ZH | \n",
+ " 8502950 | \n",
+ " 877 | \n",
+ " 47.353936 | \n",
+ " 8.437175 | \n",
+ " Birmensdorf ZH, Zentrum | \n",
+ " 0.403584 | \n",
+ " 484 | \n",
+ " 352187318288 | \n",
+ "
\n",
+ " \n",
+ " 1302 | \n",
+ " 3889 | \n",
+ " 8502221 | \n",
+ " 276 | \n",
+ " 47.357557 | \n",
+ " 8.437543 | \n",
+ " Birmensdorf ZH | \n",
+ " 8583870 | \n",
+ " 1154 | \n",
+ " 47.357234 | \n",
+ " 8.437013 | \n",
+ " Birmensdorf ZH, Bahnhof Süd | \n",
+ " 0.053666 | \n",
+ " 64 | \n",
+ " 352187318289 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " index stop_id_general stop_int stop_lat_first stop_lon_first \\\n",
+ "1300 3887 8502221 276 47.357557 8.437543 \n",
+ "1301 3888 8502221 276 47.357557 8.437543 \n",
+ "1302 3889 8502221 276 47.357557 8.437543 \n",
+ "\n",
+ " stop_name_first stop_id_general_2 stop_int_2 stop_lat_first_2 \\\n",
+ "1300 Birmensdorf ZH 8573718 473 47.357125 \n",
+ "1301 Birmensdorf ZH 8502950 877 47.353936 \n",
+ "1302 Birmensdorf ZH 8583870 1154 47.357234 \n",
+ "\n",
+ " stop_lon_first_2 stop_name_first_2 distance walking_time \\\n",
+ "1300 8.438801 Birmensdorf ZH, Bahnhof 0.106219 127 \n",
+ "1301 8.437175 Birmensdorf ZH, Zentrum 0.403584 484 \n",
+ "1302 8.437013 Birmensdorf ZH, Bahnhof Süd 0.053666 64 \n",
+ "\n",
+ " monotonically_increasing_id \n",
+ "1300 352187318287 \n",
+ "1301 352187318288 \n",
+ "1302 352187318289 "
+ ]
+ },
+ "execution_count": 58,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# transfers from Birmensdorf ZH\n",
+ "transfers[transfers['stop_id_general']==8502221]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 60,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Transfers from Dallikon Industrie"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 59,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " index | \n",
+ " stop_id_general | \n",
+ " stop_int | \n",
+ " stop_lat_first | \n",
+ " stop_lon_first | \n",
+ " stop_name_first | \n",
+ " stop_id_general_2 | \n",
+ " stop_int_2 | \n",
+ " stop_lat_first_2 | \n",
+ " stop_lon_first_2 | \n",
+ " stop_name_first_2 | \n",
+ " distance | \n",
+ " walking_time | \n",
+ " monotonically_increasing_id | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ "Empty DataFrame\n",
+ "Columns: [index, stop_id_general, stop_int, stop_lat_first, stop_lon_first, stop_name_first, stop_id_general_2, stop_int_2, stop_lat_first_2, stop_lon_first_2, stop_name_first_2, distance, walking_time, monotonically_increasing_id]\n",
+ "Index: []"
+ ]
+ },
+ "execution_count": 59,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "transfers[transfers['stop_id_general']==8576276]"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "There are no footpaths between Birmensdorf ZH and Dallikon Industrie, and interestingly, Dallikon Industrie has no footpaths at all. That points to a bug with the gestion of 'None' pointers in the array stops for footpaths"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 61,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "transfer_array = pkload(\"../data/transfer_array_cyril.pkl\")\n",
+ "stops = pkload(\"../data/stops_array_cyril.pkl\")"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 64,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "array([[3075, 1297.0],\n",
+ " [3119, 1300.0],\n",
+ " [3131, 1303.0]], dtype=object)"
+ ]
+ },
+ "execution_count": 64,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# transfers from Birmensdorf ZH\n",
+ "stop_int = 276\n",
+ "stops[stop_int-1:stop_int+2]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 65,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "array([[ 473, 127],\n",
+ " [ 877, 484],\n",
+ " [1154, 64]])"
+ ]
+ },
+ "execution_count": 65,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "transfer_array[int(stops[stop_int][1]):int(stops[stop_int+1][1])]"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "**The first entry of transfer_array[276] corresponding to Birmensdorf ZH is 473, which is one less than 474, the stop_id of Dallikon Industrie**. That may be a clue to what's going wrong with the algorithm."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 66,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "array([[5408, 2157.0],\n",
+ " [5417, nan],\n",
+ " [5420, 2160.0]], dtype=object)"
+ ]
+ },
+ "execution_count": 66,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# transfers from Dallikon Industrie\n",
+ "stop_int = 474\n",
+ "stops[stop_int-1:stop_int+2]\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 69,
+ "metadata": {},
+ "outputs": [
+ {
+ "ename": "ValueError",
+ "evalue": "cannot convert float NaN to integer",
+ "output_type": "error",
+ "traceback": [
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+ "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0;31m# Trying to access the transfer for the nan pointer (SHOULD FAIL)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mtransfer_array\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mstops\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mstop_int\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mstops\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mstop_int\u001b[0m\u001b[0;34m+\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
+ "\u001b[0;31mValueError\u001b[0m: cannot convert float NaN to integer"
+ ]
+ }
+ ],
+ "source": [
+ "# Trying to access the transfer for the nan pointer (SHOULD FAIL)\n",
+ "transfer_array[int(stops[stop_int][1]):int(stops[stop_int+1][1])]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 70,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# checking out what's around the nan pointer:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 71,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "array([[ 276, 127],\n",
+ " [ 877, 450],\n",
+ " [1154, 162]])"
+ ]
+ },
+ "execution_count": 71,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "transfer_array[int(stops[stop_int-1][1]):int(stops[stop_int+1][1])]"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "The first entry of transfer_array[stop_int-1] is 276, the stop_int of Birmensdorf ZH. However, that is unlikely to be the source of the problem as we are walking from 276 to 474, and thus accessing transfer_array through stops[276][1]."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## recapitulating the bug with another journey\n",
+ "\n",
+ "Searching for journeys from Dübendorf, Branzenäsch (stop 8590551) to Kloten, Weinbergstrasse (stop 8579967) with arrival at 17:30 gives an impossible first walk from Dübendorf, Branzenäsch to Uetliberg (stop 8503057)."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 72,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " index | \n",
+ " route_id | \n",
+ " stop_id_general | \n",
+ " trip_id | \n",
+ " stop_id | \n",
+ " arrival_time | \n",
+ " departure_time | \n",
+ " stop_sequence | \n",
+ " stop_name | \n",
+ " stop_lat | \n",
+ " stop_lon | \n",
+ " trip_headsign | \n",
+ " trip_short_name | \n",
+ " direction_id | \n",
+ " departure_first_stop | \n",
+ " route_int | \n",
+ " stop_count | \n",
+ " stop_int | \n",
+ " route_desc | \n",
+ " monotonically_increasing_id | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 95873 | \n",
+ " 110350 | \n",
+ " 26-752-j19-1 | \n",
+ " 8590551 | \n",
+ " 190.TA.26-752-j19-1.4.R | \n",
+ " 8590551 | \n",
+ " 2020-05-24 07:16:00 | \n",
+ " 2020-05-24 07:16:00 | \n",
+ " 11 | \n",
+ " Dübendorf, Branzenäsch | \n",
+ " 47.394665 | \n",
+ " 8.631157 | \n",
+ " Dübendorf, Kunsteisbahn | \n",
+ " 1420 | \n",
+ " 1 | \n",
+ " 07:06:00 | \n",
+ " 563 | \n",
+ " 15 | \n",
+ " 503 | \n",
+ " Bus | \n",
+ " 627065226053 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " index route_id stop_id_general trip_id \\\n",
+ "95873 110350 26-752-j19-1 8590551 190.TA.26-752-j19-1.4.R \n",
+ "\n",
+ " stop_id arrival_time departure_time stop_sequence \\\n",
+ "95873 8590551 2020-05-24 07:16:00 2020-05-24 07:16:00 11 \n",
+ "\n",
+ " stop_name stop_lat stop_lon trip_headsign \\\n",
+ "95873 Dübendorf, Branzenäsch 47.394665 8.631157 Dübendorf, Kunsteisbahn \n",
+ "\n",
+ " trip_short_name direction_id departure_first_stop route_int \\\n",
+ "95873 1420 1 07:06:00 563 \n",
+ "\n",
+ " stop_count stop_int route_desc monotonically_increasing_id \n",
+ "95873 15 503 Bus 627065226053 "
+ ]
+ },
+ "execution_count": 72,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# Dübendorf, Branzenäsch\n",
+ "stop_times[stop_times['stop_id_general']== 8590551].head(1)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 73,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " index | \n",
+ " route_id | \n",
+ " stop_id_general | \n",
+ " trip_id | \n",
+ " stop_id | \n",
+ " arrival_time | \n",
+ " departure_time | \n",
+ " stop_sequence | \n",
+ " stop_name | \n",
+ " stop_lat | \n",
+ " stop_lon | \n",
+ " trip_headsign | \n",
+ " trip_short_name | \n",
+ " direction_id | \n",
+ " departure_first_stop | \n",
+ " route_int | \n",
+ " stop_count | \n",
+ " stop_int | \n",
+ " route_desc | \n",
+ " monotonically_increasing_id | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 5304 | \n",
+ " 51749 | \n",
+ " 26-10-B-j19-1 | \n",
+ " 8503057 | \n",
+ " 181.TA.26-10-B-j19-1.9.H | \n",
+ " 8503057 | \n",
+ " 2020-05-24 07:14:00 | \n",
+ " NaT | \n",
+ " 8 | \n",
+ " Uetliberg | \n",
+ " 47.352366 | \n",
+ " 8.487651 | \n",
+ " Uetliberg | \n",
+ " 23511 | \n",
+ " 0 | \n",
+ " 07:03:00 | \n",
+ " 62 | \n",
+ " 4 | \n",
+ " 415 | \n",
+ " S-Bahn | \n",
+ " 25769805095 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " index route_id stop_id_general trip_id \\\n",
+ "5304 51749 26-10-B-j19-1 8503057 181.TA.26-10-B-j19-1.9.H \n",
+ "\n",
+ " stop_id arrival_time departure_time stop_sequence stop_name \\\n",
+ "5304 8503057 2020-05-24 07:14:00 NaT 8 Uetliberg \n",
+ "\n",
+ " stop_lat stop_lon trip_headsign trip_short_name direction_id \\\n",
+ "5304 47.352366 8.487651 Uetliberg 23511 0 \n",
+ "\n",
+ " departure_first_stop route_int stop_count stop_int route_desc \\\n",
+ "5304 07:03:00 62 4 415 S-Bahn \n",
+ "\n",
+ " monotonically_increasing_id \n",
+ "5304 25769805095 "
+ ]
+ },
+ "execution_count": 73,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# Uetliberg (stop 8503057)\n",
+ "stop_times[stop_times['stop_id_general']== 8503057].head(1)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "A google maps search for footpaths between the coordinates yields a 14.5 km walk."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 74,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " index | \n",
+ " stop_id_general | \n",
+ " stop_int | \n",
+ " stop_lat_first | \n",
+ " stop_lon_first | \n",
+ " stop_name_first | \n",
+ " stop_id_general_2 | \n",
+ " stop_int_2 | \n",
+ " stop_lat_first_2 | \n",
+ " stop_lon_first_2 | \n",
+ " stop_name_first_2 | \n",
+ " distance | \n",
+ " walking_time | \n",
+ " monotonically_increasing_id | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 2256 | \n",
+ " 2938 | \n",
+ " 8590551 | \n",
+ " 503 | \n",
+ " 47.394665 | \n",
+ " 8.631157 | \n",
+ " Dübendorf, Branzenäsch | \n",
+ " 8590587 | \n",
+ " 414 | \n",
+ " 47.393053 | \n",
+ " 8.633367 | \n",
+ " Dübendorf, Sonnenberg | \n",
+ " 0.244501 | \n",
+ " 293 | \n",
+ " 618475290624 | \n",
+ "
\n",
+ " \n",
+ " 2257 | \n",
+ " 2939 | \n",
+ " 8590551 | \n",
+ " 503 | \n",
+ " 47.394665 | \n",
+ " 8.631157 | \n",
+ " Dübendorf, Branzenäsch | \n",
+ " 8590555 | \n",
+ " 599 | \n",
+ " 47.394877 | \n",
+ " 8.628714 | \n",
+ " Dübendorf, Claridenstrasse | \n",
+ " 0.185439 | \n",
+ " 222 | \n",
+ " 618475290625 | \n",
+ "
\n",
+ " \n",
+ " 2258 | \n",
+ " 2940 | \n",
+ " 8590551 | \n",
+ " 503 | \n",
+ " 47.394665 | \n",
+ " 8.631157 | \n",
+ " Dübendorf, Branzenäsch | \n",
+ " 8590581 | \n",
+ " 886 | \n",
+ " 47.391557 | \n",
+ " 8.634876 | \n",
+ " Dübendorf, Raubbühl | \n",
+ " 0.444715 | \n",
+ " 533 | \n",
+ " 618475290626 | \n",
+ "
\n",
+ " \n",
+ " 2259 | \n",
+ " 2941 | \n",
+ " 8590551 | \n",
+ " 503 | \n",
+ " 47.394665 | \n",
+ " 8.631157 | \n",
+ " Dübendorf, Branzenäsch | \n",
+ " 8590550 | \n",
+ " 931 | \n",
+ " 47.397048 | \n",
+ " 8.625614 | \n",
+ " Dübendorf, Bettlistrasse | \n",
+ " 0.494279 | \n",
+ " 593 | \n",
+ " 618475290627 | \n",
+ "
\n",
+ " \n",
+ " 2260 | \n",
+ " 2942 | \n",
+ " 8590551 | \n",
+ " 503 | \n",
+ " 47.394665 | \n",
+ " 8.631157 | \n",
+ " Dübendorf, Branzenäsch | \n",
+ " 8590590 | \n",
+ " 1226 | \n",
+ " 47.390535 | \n",
+ " 8.632469 | \n",
+ " Dübendorf, Sunnhalde | \n",
+ " 0.469644 | \n",
+ " 563 | \n",
+ " 618475290628 | \n",
+ "
\n",
+ " \n",
+ " 2261 | \n",
+ " 2943 | \n",
+ " 8590551 | \n",
+ " 503 | \n",
+ " 47.394665 | \n",
+ " 8.631157 | \n",
+ " Dübendorf, Branzenäsch | \n",
+ " 8590562 | \n",
+ " 1244 | \n",
+ " 47.396240 | \n",
+ " 8.629935 | \n",
+ " Dübendorf, Glärnischstrasse | \n",
+ " 0.197806 | \n",
+ " 237 | \n",
+ " 618475290629 | \n",
+ "
\n",
+ " \n",
+ " 2262 | \n",
+ " 2944 | \n",
+ " 8590551 | \n",
+ " 503 | \n",
+ " 47.394665 | \n",
+ " 8.631157 | \n",
+ " Dübendorf, Branzenäsch | \n",
+ " 8590549 | \n",
+ " 1392 | \n",
+ " 47.394817 | \n",
+ " 8.634580 | \n",
+ " Dübendorf, Bauhof | \n",
+ " 0.258181 | \n",
+ " 309 | \n",
+ " 618475290630 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " index stop_id_general stop_int stop_lat_first stop_lon_first \\\n",
+ "2256 2938 8590551 503 47.394665 8.631157 \n",
+ "2257 2939 8590551 503 47.394665 8.631157 \n",
+ "2258 2940 8590551 503 47.394665 8.631157 \n",
+ "2259 2941 8590551 503 47.394665 8.631157 \n",
+ "2260 2942 8590551 503 47.394665 8.631157 \n",
+ "2261 2943 8590551 503 47.394665 8.631157 \n",
+ "2262 2944 8590551 503 47.394665 8.631157 \n",
+ "\n",
+ " stop_name_first stop_id_general_2 stop_int_2 stop_lat_first_2 \\\n",
+ "2256 Dübendorf, Branzenäsch 8590587 414 47.393053 \n",
+ "2257 Dübendorf, Branzenäsch 8590555 599 47.394877 \n",
+ "2258 Dübendorf, Branzenäsch 8590581 886 47.391557 \n",
+ "2259 Dübendorf, Branzenäsch 8590550 931 47.397048 \n",
+ "2260 Dübendorf, Branzenäsch 8590590 1226 47.390535 \n",
+ "2261 Dübendorf, Branzenäsch 8590562 1244 47.396240 \n",
+ "2262 Dübendorf, Branzenäsch 8590549 1392 47.394817 \n",
+ "\n",
+ " stop_lon_first_2 stop_name_first_2 distance walking_time \\\n",
+ "2256 8.633367 Dübendorf, Sonnenberg 0.244501 293 \n",
+ "2257 8.628714 Dübendorf, Claridenstrasse 0.185439 222 \n",
+ "2258 8.634876 Dübendorf, Raubbühl 0.444715 533 \n",
+ "2259 8.625614 Dübendorf, Bettlistrasse 0.494279 593 \n",
+ "2260 8.632469 Dübendorf, Sunnhalde 0.469644 563 \n",
+ "2261 8.629935 Dübendorf, Glärnischstrasse 0.197806 237 \n",
+ "2262 8.634580 Dübendorf, Bauhof 0.258181 309 \n",
+ "\n",
+ " monotonically_increasing_id \n",
+ "2256 618475290624 \n",
+ "2257 618475290625 \n",
+ "2258 618475290626 \n",
+ "2259 618475290627 \n",
+ "2260 618475290628 \n",
+ "2261 618475290629 \n",
+ "2262 618475290630 "
+ ]
+ },
+ "execution_count": 74,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# footpaths from Dübendorf, Branzenäsch\n",
+ "transfers[transfers['stop_id_general']== 8590551]"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "No sign of Uetliberg here."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 75,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " index | \n",
+ " stop_id_general | \n",
+ " stop_int | \n",
+ " stop_lat_first | \n",
+ " stop_lon_first | \n",
+ " stop_name_first | \n",
+ " stop_id_general_2 | \n",
+ " stop_int_2 | \n",
+ " stop_lat_first_2 | \n",
+ " stop_lon_first_2 | \n",
+ " stop_name_first_2 | \n",
+ " distance | \n",
+ " walking_time | \n",
+ " monotonically_increasing_id | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ "Empty DataFrame\n",
+ "Columns: [index, stop_id_general, stop_int, stop_lat_first, stop_lon_first, stop_name_first, stop_id_general_2, stop_int_2, stop_lat_first_2, stop_lon_first_2, stop_name_first_2, distance, walking_time, monotonically_increasing_id]\n",
+ "Index: []"
+ ]
+ },
+ "execution_count": 75,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# transfers from Uetliberg (stop 8503057)\n",
+ "transfers[transfers['stop_id_general']== 8503057]"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Again, utliberg has no footpaths, like Dallikon Industrie in the previous bug."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 79,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "array([[5599, 2253.0],\n",
+ " [5603, 2256.0],\n",
+ " [5606, 2263.0]], dtype=object)"
+ ]
+ },
+ "execution_count": 79,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# footpaths from Dübendorf, Branzenäsch\n",
+ "stop_int = 503\n",
+ "stops[stop_int-1:stop_int+2]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 80,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "array([[ 414, 293],\n",
+ " [ 599, 222],\n",
+ " [ 886, 533],\n",
+ " [ 931, 593],\n",
+ " [1226, 563],\n",
+ " [1244, 237],\n",
+ " [1392, 309]])"
+ ]
+ },
+ "execution_count": 80,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "transfer_array[int(stops[stop_int][1]):int(stops[stop_int+1][1])]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 51,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "array([[5599, 2253.0],\n",
+ " [5603, 2256.0]], dtype=object)"
+ ]
+ },
+ "execution_count": 51,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "stops[stop_int-1:stop_int+1]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 4
+}