checking if time difference between stations are the same

checking if the time differences between each train run and station is the same

When creating a system that automatically populates the timings for each station, it is vital to know whether timings remain constant for all the trains that run on that route. What I'm talking about is: does the time taken to get from station A to station B remain the same for all trains going from A to B ?


To check this, I scraped the time table from punediary.com using a tool called scrapy. The following is the output of the script that parses the scraped data, cleans it, and calculates the time difference for every station along with the average.


The code and data files are hosted at: scrape-train-timings (github.com/coolharsh55)


---- UP LOCALS ----

  • A: PUNE STATION
  • B: SHIVAJINAGAR
  • C: KHADKI
  • D: DAPODI
  • E: KASARWADI
  • F: PIMPRI
  • G: CHINCHWAD
  • H: AKURDI
  • I: DEHU ROAD
  • J: BEGDEWADI
  • K: GORAWADI
  • L: TALEGAON
  • M: WADGAON
  • N: KANHE
  • O: KAMSHET
  • P: MALWALI
  • Q: LONAWALA

train timings for up side locals

A B C D E F G H I J K L M N O P Q
1 00:10 00:16 00:21 00:26 00:30 00:33 00:37 00:42 00:47 00:51 00:54 00:59 01:04 01:09 01:13 01:21 01:35
2 04:45 04:51 04:56 05:01 05:05 05:08 05:12 05:17 05:22 05:26 05:29 05:34 05:39 05:44 05:48 05:56 06:10
3 05:45 05:51 05:56 06:01 06:05 06:08 06:12 06:17 06:22 06:26 06:29 06:34 06:39 06:44 06:48 06:56 07:10
4 06:30 06:36 06:41 06:46 06:50 06:53 06:57 07:02 07:07 07:11 07:14 07:19 07:23 07:29 07:33 07:41 07:55
5 06:50 06:56 07:01 07:06 07:10 07:13 07:17 07:22 07:27 07:31 07:34 07:39 XX:XX XX:XX XX:XX XX:XX XX:XX
6 08:05 08:11 08:16 08:21 08:25 08:28 08:32 08:37 08:42 08:47 08:49 08:54 08:59 09:04 09:08 09:16 09:30
7 08:57 09:03 09:08 09:13 09:17 09:20 09:24 09:29 09:34 09:38 09:41 09:46 XX:XX XX:XX XX:XX XX:XX XX:XX
8 09:55 10:01 10:06 10:11 10:15 10:18 10:22 10:27 10:32 10:36 10:39 10:45 10:50 10:54 10:59 11:07 11:20
9 XX:XX 10:50 10:56 11:01 11:05 11:08 11:12 11:17 11:22 11:26 11:29 11:35 11:40 11:44 11:49 11:57 12:10
10 11:55 12:01 12:06 12:11 12:15 12:18 12:22 12:27 12:32 12:36 12:39 12:44 12:49 12:54 12:59 13:06 13:20
11 13:00 13:06 13:11 13:16 13:20 13:23 13:27 13:32 13:37 13:41 13:44 13:49 13:54 13:59 14:03 14:12 14:26
12 15:00 15:06 15:11 15:16 15:20 15:23 15:27 15:32 15:37 15:41 15:44 15:49 15:54 15:59 16:03 16:12 16:26
13 15:40 15:46 15:51 15:56 16:00 16:03 16:07 16:12 16:17 16:21 16:24 16:29 XX:XX XX:XX XX:XX XX:XX XX:XX
14 16:25 16:31 16:36 16:41 16:45 16:47 16:52 16:57 17:02 17:06 17:09 17:14 17:19 17:24 17:28 17:36 17:50
15 17:10 17:16 17:21 17:26 17:30 17:33 17:37 17:42 17:47 17:51 17:54 17:59 XX:XX XX:XX XX:XX XX:XX XX:XX
16 18:02 18:08 18:13 18:18 18:22 18:25 18:29 18:34 18:39 18:43 18:46 18:51 18:56 19:01 19:05 19:14 19:28
17 19:05 19:11 19:16 19:21 19:25 19:28 19:32 19:37 19:42 19:46 19:49 19:54 19:59 20:04 20:08 20:16 20:30
18 XX:XX 19:35 19:39 19:44 19:48 19:51 19:55 20:00 20:05 20:10 20:13 20:18 20:23 20:28 20:32 20:40 20:54
19 20:00 20:06 20:11 20:16 20:20 20:23 20:27 20:32 20:37 20:41 20:44 20:49 20:54 20:59 21:03 21:11 21:25
20 21:05 21:11 21:16 21:21 21:25 21:27 21:32 21:37 21:42 21:46 21:49 21:54 21:59 22:04 22:08 22:16 22:30
21 22:10 22:16 22:21 22:26 22:30 22:33 22:37 22:42 22:47 22:51 22:54 22:59 23:04 23:09 23:13 23:21 23:35
22 23:00 23:06 23:11 23:16 23:20 23:23 23:27 23:32 23:37 23:41 23:44 23:49 XX:XX XX:XX XX:XX XX:XX XX:XX

time difference between stations for locals going from Pune to Lonavala

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 AVG
A 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
B 6 6 6 6 6 6 6 6 0 6 6 6 6 6 6 6 6 0 6 6 6 6 6
C 5 5 5 5 5 5 5 5 6 5 5 5 5 5 5 5 5 4 5 5 5 5 5
D 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
E 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
F 3 3 3 3 3 3 3 3 3 3 3 3 3 2 3 3 3 3 3 2 3 3 3
G 4 4 4 4 4 4 4 4 4 4 4 4 4 5 4 4 4 4 4 5 4 4 5
H 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
I 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
J 4 4 4 4 4 5 4 4 4 4 4 4 4 4 4 4 4 5 4 4 4 4 5
K 3 3 3 3 3 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
L 5 5 5 5 5 5 5 6 6 5 5 5 5 5 5 5 5 5 5 5 5 5 6
M 5 5 5 4 0 5 0 5 5 5 5 5 0 5 0 5 5 5 5 5 5 0 5
N 5 5 5 6 0 5 0 4 4 5 5 5 0 5 0 5 5 5 5 5 5 0 5
O 4 4 4 4 0 4 0 5 5 5 4 4 0 4 0 4 4 4 4 4 4 0 5
P 8 8 8 8 0 8 0 8 8 7 9 9 0 8 0 9 8 8 8 8 8 0 9
Q 14 14 14 14 0 14 0 13 13 14 14 14 0 14 0 14 14 14 14 14 14 0 14


average time difference for trains going from Pune to Lonavala

FROM TO AVERAGE TIME
PUNESTATION SHIVAJINAGAR 6
SHIVAJINAGAR KHADKI 5
KHADKI DAPODI 5
DAPODI KASARWADI 4
KASARWADI PIMPRI 3
PIMPRI CHINCHWAD 5
CHINCHWAD AKURDI 5
AKURDI DEHU 5
DEHU ROAD 5
BEGDEWADI GORAWADI 3
GORAWADI TALEGAON 6
TALEGAON WADGAON 5
WADGAON KANHE 5
KANHE KAMSHET 5
KAMSHET MALWALI 9
MALWALI LONAWALA 4
train timings for down side locals
A B C D E F G H I J K L M N O P Q AVG
1 XX:XX XX:XX XX:XX XX:XX XX:XX 00:05 00:09 00:13 00:17 00:21 00:26 00:30 00:33 00:37 00:41 00:46 00:58
2 05:20 05:29 05:37 05:41 05:46 05:52 05:56 06:00 06:04 06:08 06:13 06:17 06:20 06:24 06:28 06:33 06:45
3 06:20 06:29 06:37 06:41 06:46 06:52 06:56 07:00 07:04 07:08 07:13 07:17 07:20 07:24 07:28 07:33 07:45
4 07:20 07:29 07:37 07:41 07:46 07:52 07:56 08:00 08:04 08:08 08:13 08:17 08:20 08:24 08:28 08:33 08:45
5 XX:XX XX:XX XX:XX XX:XX XX:XX 07:50 07:54 07:58 08:02 08:06 08:11 08:15 08:18 08:22 08:26 08:31 08:43
6 08:20 08:29 08:37 08:41 08:46 08:52 08:56 09:00 09:04 09:08 09:13 09:17 09:20 09:24 09:28 09:33 09:45
7 XX:XX XX:XX XX:XX XX:XX XX:XX 09:57 10:01 10:08 10:12 10:16 10:21 10:25 10:28 10:32 10:36 10:41 XX:XX
8 09:35 09:44 09:52 09:56 10:01 10:07 10:11 10:15 10:19 10:23 10:28 10:32 10:35 10:39 10:43 10:48 11:00
9 11:20 11:29 11:37 11:41 11:46 11:52 11:56 12:00 12:04 12:08 12:13 12:17 12:20 12:24 12:28 12:33 12:45
10 14:00 14:09 14:17 14:21 14:26 14:32 14:36 14:40 14:44 14:48 14:53 14:56 15:00 15:04 15:08 15:13 15:25
11 14:55 15:04 15:12 15:16 15:22 15:28 15:32 15:36 15:40 15:44 15:49 15:53 15:57 16:02 16:06 16:09 16:21
12 15:45 15:54 16:02 16:06 16:11 16:17 16:21 16:25 16:29 16:33 16:38 16:42 16:45 16:49 16:53 16:58 17:10
13 XX:XX XX:XX XX:XX XX:XX XX:XX 16:40 16:44 16:48 16:52 16:56 17:01 17:05 17:08 17:12 17:16 17:21 17:33
14 17:25 17:34 17:42 17:46 17:51 17:57 18:01 18:05 18:09 18:13 18:18 18:22 18:27 18:29 18:33 18:38 18:50
15 18:20 18:29 18:37 18:41 18:46 18:52 18:56 19:00 19:04 19:08 19:13 19:17 19:20 19:24 19:28 19:33 19:45
16 19:35 19:44 19:52 19:56 20:01 20:07 20:11 20:15 20:19 20:23 20:28 20:32 20:35 20:39 20:43 20:48 21:00
17 20:40 20:49 20:57 21:01 21:06 21:11 21:16 21:20 21:24 21:28 21:33 21:37 21:40 21:44 21:48 21:54 22:06
18 21:15 21:24 21:32 21:36 21:41 21:47 21:51 21:55 21:59 22:03 22:08 22:12 22:15 22:19 22:23 22:28 22:40
19 22:05 22:14 22:22 22:26 22:31 22:37 22:41 22:45 22:49 22:53 22:58 23:02 23:05 23:09 23:13 23:18 23:30
20 22:35 22:44 22:52 22:56 23:01 23:07 23:11 23:15 23:19 23:23 23:28 23:32 23:35 23:39 23:43 23:48 00:00
21 23:45 23:54 00:02 00:06 00:11 00:17 00:21 00:25 00:29 00:33 00:38 00:42 00:45 00:49 00:53 00:58 01:10
time difference between stations for locals going from Lonavala to Pune
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 AVG
A 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
B 0 9 9 9 0 9 0 9 9 9 9 9 0 9 9 9 9 9 9 9 9 9
C 0 8 8 8 0 8 0 8 8 8 8 8 0 8 8 8 8 8 8 8 8 8
D 0 4 4 4 0 4 0 4 4 4 4 4 0 4 4 4 4 4 4 4 4 4
E 0 5 5 5 0 5 0 5 5 5 6 5 0 5 5 5 5 5 5 5 5 6
F 0 6 6 6 0 6 0 6 6 6 6 6 0 6 6 6 5 6 6 6 6 6
G 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 4 4 4 4 5
H 4 4 4 4 4 4 7 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5
I 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
J 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
K 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
L 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 4 4 4 4
M 3 3 3 3 3 3 3 3 3 4 4 3 3 5 3 3 3 3 3 3 3 4
N 4 4 4 4 4 4 4 4 4 4 5 4 4 2 4 4 4 4 4 4 4 4
O 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
P 5 5 5 5 5 5 5 5 5 5 3 5 5 5 5 5 6 5 5 5 5 5
Q 12 12 12 12 12 12 0 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12


average time difference for trains going from Lonavala to Pune

FROM TO AVERAGE TIME
LONAWALA MALWALI 9
MALWALI KAMSHET 8
KAMSHET KANHE 4
KANHE WADGAON 6
WADGAON TALEGAON 6
TALEGAON GORAWADI 5
GORAWADI BEGDEWADI 5
BEGDEWADI DEHUROAD 4
DEHUROAD AKURDI 4
AKURDI CHINCHWAD 5
CHINCHWAD PIMPRI 4
PIMPRI KASARWADI 4
KASARWADI DAPODI 4
DAPODI KHADKI 4
KHADKI SHIVAJINAGAR 5
SHIVAJINAGAR PUNE STATION 12