@@ -92,16 +92,16 @@ A snapshot of the data contained in ``loc_a_codes`` is demonstrated below:
9292 3 A483 Road Scheme Supervisors Closed ...
9393 4 Aachen ...
9494 ... ... .. ... ... ...
95- 3319 Ayr Wagon Team ...
96- 3320 Ayr Wagon Team ...
97- 3321 Ayr Wagon Team ...
98- 3322 Ayr Welders ...
99- 3323 Aztec Travel S378 ...
100- [3324 rows x 12 columns]
95+ 3322 Ayr Wagon Team ...
96+ 3323 Ayr Wagon Team ...
97+ 3324 Ayr Wagon Team ...
98+ 3325 Ayr Welders ...
99+ 3326 Aztec Travel S378 ...
100+ [3327 rows x 12 columns]
101101 >> > print (f " Notes: { loc_a_codes[' Notes' ]} " )
102102 >> > print (f " Last updated date: { loc_a_codes[' Last updated date' ]} " )
103103 Notes: None
104- Last updated date: 2025 - 0 6 - 0 4
104+ Last updated date: 2025 - 12 - 11
105105
106106 >> > # # Try more examples! Uncomment the lines below and run:
107107 >> > # loc_a_codes = lid.fetch_loc_id('a') # Fetch location codes starting with 'A'
@@ -153,12 +153,12 @@ Here is a snapshot of the data contained in ``loc_codes``:
153153 3 A483 Road Scheme Supervisors Closed ...
154154 4 Aachen ...
155155 ... ... .. ... ... ...
156- 59949 ZZTYALS ...
157- 59950 ZZTYKKH ...
158- 59951 ZZTYLIN ...
159- 59952 ZZTYSGY ...
160- 59953 ZZWMNST ...
161- [59954 rows x 12 columns]
156+ 60023 ZZTYALS ...
157+ 60024 ZZTYKKH ...
158+ 60025 ZZTYLIN ...
159+ 60026 ZZTYSGY ...
160+ 60027 ZZWMNST ...
161+ [60028 rows x 12 columns]
162162 >> > loc_codes_dat[[' Location' , ' Location_Note' ]]
163163 Location Location_Note
164164 0 1999 Reorganisations
@@ -167,12 +167,12 @@ Here is a snapshot of the data contained in ``loc_codes``:
167167 3 A483 Road Scheme Supervisors Closed
168168 4 Aachen
169169 ... ... ...
170- 59949 ZZTYALS see Alston
171- 59950 ZZTYKKH see Kirkhaugh
172- 59951 ZZTYLIN see Lintley
173- 59952 ZZTYSGY see Slaggyford
174- 59953 ZZWMNST see Westminster
175- [59954 rows x 2 columns]
170+ 60023 ZZTYALS see Alston
171+ 60024 ZZTYKKH see Kirkhaugh
172+ 60025 ZZTYLIN see Lintley
173+ 60026 ZZTYSGY see Slaggyford
174+ 60027 ZZWMNST see Westminster
175+ [60028 rows x 2 columns]
176176
177177 To access codes from other systems, such as Crossrail or the Tyne & Wear Metro:
178178
@@ -182,7 +182,7 @@ To access codes from other systems, such as Crossrail or the Tyne & Wear Metro:
182182 ' Other systems'
183183 >> > os_codes_dat = loc_codes[lid.KEY_TO_OTHER_SYSTEMS ]
184184 >> > type (os_codes_dat)
185- collections.defaultdict
185+ dict
186186 >> > list (os_codes_dat.keys())
187187 [' Córas Iompair Éireann (Republic of Ireland)' ,
188188 ' Crossrail' ,
@@ -200,13 +200,19 @@ For example, to view the data for Crossrail:
200200 >> > type (crossrail_codes_dat)
201201 pandas.core.frame.DataFrame
202202 >> > crossrail_codes_dat.head()
203- Location ... New operating code
204- 0 Abbey Wood ... ABW
205- 1 Abbey Wood Bolthole Berth/ Crossrail Sidings ...
206- 2 Abbey Wood Sidings ...
207- 3 Bond Street ... BDS
208- 4 Canary Wharf ... CWX
209- [5 rows x 5 columns]
203+ Location ... New operating code
204+ 0 Abbey Wood ... ABW
205+ 1 Abbey Wood Bolthole Berth/ Crossrail Sidings ...
206+ 2 Abbey Wood Sidings ...
207+ 3 Bond Street ... BDS
208+ 4 Canary Wharf ... CWX
209+ ... ... ... ...
210+ 26 Whitechapel ... ZLW
211+ 27 Whitechapel Vallance Road Crossover ...
212+ 28 Woolwich ... WWC
213+ 29 [unknown] ...
214+ 30 [unknown] ...
215+ [31 rows x 5 columns]
210216
211217 >> > # # Try more examples! Uncomment the lines below and run:
212218 >> > # # Get a dictionary for STANOX codes and location names
@@ -320,12 +326,12 @@ Here is a snapshot of the data contained in ``elrs_codes``:
320326 3 ABB ... Now AHB
321327 4 ABB ...
322328 ... ... ... ...
323- 4570 ZGW1 ...
324- 4571 ZGW2 ...
325- 4572 ZZY ...
326- 4573 ZZZ ...
327- 4574 ZZZ9 ...
328- [4575 rows x 5 columns]
329+ 4573 ZGW1 ...
330+ 4574 ZGW2 ...
331+ 4575 ZZY ...
332+ 4576 ZZZ ...
333+ 4577 ZZZ9 ...
334+ [4578 rows x 5 columns]
329335
330336 >> > # # Try more examples! Uncomment the lines below and run:
331337 >> > # elrs_a_codes = em.fetch_elr(initial='a') # Fetch ELRs starting with 'A'
@@ -458,25 +464,25 @@ Here is a snapshot of the data contained in ``stn_loc_a``:
458464 >> > type (stn_loc_a_codes_dat)
459465 pandas.core.frame.DataFrame
460466 >> > stn_loc_a_codes_dat
461- Station ... Former Operator
462- 0 Abbey Wood Abbey Wood / ABBEY WOOD ... London & South Eastern Rai ...
463- 1 Abbey Wood Abbey Wood / ABBEY WOOD ... London & South Eastern Rai ...
464- 2 Aber ... Keolis Amey Operations/ Gwe ...
465- 3 Abercynon ... Keolis Amey Operations/ Gwe ...
466- 4 Abercynon ... Keolis Amey Operations/ Gwe ...
467- .. ... ... ...
468- 137 Aylesbury Vale Parkway ...
469- 138 Aylesford ... London & South Eastern Rai ...
470- 139 Aylesham ... London & South Eastern Rai ...
471- 140 Ayr ... Abellio ScotRail from 1 Ap ...
472- 141 Ayr ... Abellio ScotRail from 1 Ap ...
473- [142 rows x 14 columns]
467+ Station ... Former Operator
468+ 0 Abbey Wood Abbey Wood / ABBEY WOOD ... MTR Corporation (Crossrail) ...
469+ 1 Abbey Wood Abbey Wood / ABBEY WOOD ... MTR Corporation (Crossrail) ...
470+ 2 Aber ... Keolis Amey Operations/ Gwei ...
471+ 3 Abercynon ... Keolis Amey Operations/ Gwei ...
472+ 4 Abercynon ... Keolis Amey Operations/ Gwei ...
473+ .. ... ... ...
474+ 138 Aylesbury Vale Parkway ...
475+ 139 Aylesford ... London & South Eastern Rail ...
476+ 140 Aylesham ... London & South Eastern Rail ...
477+ 141 Ayr ... Abellio ScotRail from 1 Apr ...
478+ 142 Ayr ... Abellio ScotRail from 1 Apr ...
479+ [143 rows x 14 columns]
474480 >> > stn_loc_a_codes_dat.columns.to_list()
475481 [' Station' ,
476482 ' Station Note' ,
477483 ' ELR' ,
478484 ' Mileage' ,
479- ' Status ' ,
485+ ' Note ' ,
480486 ' Degrees Longitude' ,
481487 ' Degrees Latitude' ,
482488 ' Grid Reference' ,
@@ -494,14 +500,14 @@ Here is a snapshot of the data contained in ``stn_loc_a``:
494500 3 Abercynon CAM 16m 28ch
495501 4 Abercynon ABD 16m 28ch
496502 .. ... ... ...
497- 137 Aylesbury Vale Parkway MCJ2 40m 38ch
498- 138 Aylesford PWS2 38m 74ch
499- 139 Aylesham FDM 68m 66ch
500- 140 Ayr AYR6 40m 49ch
501- 141 Ayr STR1 40m 49ch
502- [142 rows x 3 columns]
503+ 138 Aylesbury Vale Parkway MCJ2 40m 38ch
504+ 139 Aylesford PWS2 38m 74ch
505+ 140 Aylesham FDM 68m 66ch
506+ 141 Ayr AYR6 40m 49ch
507+ 142 Ayr STR1 40m 49ch
508+ [143 rows x 3 columns]
503509 >> > print (f " Last updated date: { stn_loc_a_codes[' Last updated date' ]} " )
504- Last updated date: 2025 - 0 6 - 16
510+ Last updated date: 2025 - 12 - 17
505511
506512 .. _quickstart-all-available-railway-stations :
507513
@@ -538,29 +544,30 @@ Here is a snapshot of the data contained in ``stn_loc_codes``:
538544 >> > type (stn_loc_codes_dat)
539545 pandas.core.frame.DataFrame
540546 >> > stn_loc_codes_dat
541- Station ... Former Operator
542- 0 Abbey Wood Abbey Wood / ABBEY WOOD ... London & South Eastern Ra...
543- 1 Abbey Wood Abbey Wood / ABBEY WOOD ... London & South Eastern Ra...
544- 2 Aber ... Keolis Amey Operations/ Gw...
545- 3 Abercynon ... Keolis Amey Operations/ Gw...
546- 4 Abercynon ... Keolis Amey Operations/ Gw...
547- ... ... ... ...
548- 2901 York ... East Coast Main Line Comp...
549- 2902 York ... East Coast Main Line Comp...
550- 2903 Yorton ... Keolis Amey Operations/ Gw...
551- 2904 Ystrad Mynach ... Keolis Amey Operations/ Gw...
552- 2905 Ystrad Rhondda ... Keolis Amey Operations/ Gw...
553- [2906 rows x 14 columns]
554- >> > sel_cols = [' Station' , ' ELR' , ' Mileage' , ' Degrees Longitude' , ' Degrees Latitude' ]
555- >> > stn_loc_codes_dat[sel_cols].tail()
556- Station ELR Mileage Degrees Longitude Degrees Latitude
557- 2901 York ECM5 0m 00ch - 1.0920 53.9584
558- 2902 York ECM4 188m 40ch - 1.0920 53.9584
559- 2903 Yorton SYC 25m 14ch - 2.7360 52.8083
560- 2904 Ystrad Mynach CAR 13m 60ch - 3.2414 51.6414
561- 2905 Ystrad Rhondda THT 20m 05ch - 3.4666 51.6436
547+ Station ... Former Operator
548+ 0 Abbey Wood Abbey Wood / ABBEY WOOD ... MTR Corporation (Crossrail)...
549+ 1 Abbey Wood Abbey Wood / ABBEY WOOD ... MTR Corporation (Crossrail)...
550+ 2 Aber ... Keolis Amey Operations/ Gwei...
551+ 3 Abercynon ... Keolis Amey Operations/ Gwei...
552+ 4 Abercynon ... Keolis Amey Operations/ Gwei...
553+ ... ... ... ...
554+ 2912 York ... East Coast Main Line Compa...
555+ 2913 York ... East Coast Main Line Compa...
556+ 2914 Yorton ... Keolis Amey Operations/ Gwe...
557+ 2915 Ystrad Mynach ... Keolis Amey Operations/ Gwe...
558+ 2916 Ystrad Rhondda ... Keolis Amey Operations/ Gwe...
559+ [2917 rows x 14 columns]
560+ >> > loc_cols = [' Station' , ' ELR' , ' Mileage' , ' Degrees Longitude' , ' Degrees Latitude' ]
561+ >> > stn_loc_codes_dat[loc_cols].head()
562+ Station ELR ... Degrees Longitude Degrees Latitude
563+ 0 Abbey Wood Abbey Wood / ABBEY WOOD NKL ... 0.1204 51.4908
564+ 1 Abbey Wood Abbey Wood / ABBEY WOOD XRS ... 0.1204 51.4908
565+ 2 Aber CAR ... - 3.2305 51.5755
566+ 3 Abercynon CAM ... - 3.3294 51.6434
567+ 4 Abercynon ABD ... - 3.3294 51.6434
568+ [5 rows x 5 columns]
562569 >> > print (f " Last updated date: { stn_loc_codes[' Last updated date' ]} " )
563- Last updated date: 2025 - 0 7 - 0 3
570+ Last updated date: 2025 - 12 - 23
564571
565572 >> > # # Try more examples! Uncomment the lines below and run:
566573 >> > # stn_loc_a_codes = em.fetch_locations('a') # railway stations starting with 'A'
0 commit comments