You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/quick-start.rst
+48-18Lines changed: 48 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -52,26 +52,29 @@ Alternatively, we can create the instance using the :class:`~pyrcs.collector.Lin
52
52
Location identifiers by initial letter
53
53
--------------------------------------
54
54
55
-
We can retrieve codes (in `pandas.DataFrame`_ format) for all locations starting with a specific letter using the :meth:`LocationIdentifiers.collect_codes_by_initial()<pyrcs.line_data.LocationIdentifiers.collect_codes_by_initial>` method. This input value for the parameter is case-insensitive. For example, to get the codes for locations whose names begin with the letter ``'A'`` (or ``'a'``):
55
+
We can retrieve codes (in `pandas.DataFrame`_ format) for all locations starting with a specific letter using the :meth:`LocationIdentifiers.collect_loc_id()<pyrcs.line_data.LocationIdentifiers.collect_loc_id>` method. This input value for the parameter is case-insensitive. For example, to get the codes for locations whose names begin with the letter ``'A'`` (or ``'a'``):
To collect data of CRS, NLC, TIPLOCandSTANOX codes beginning with"A"
61
+
? [No]|Yes: yes
62
+
Collecting the data ... Done.
60
63
>>>type(loc_a_codes)
61
64
dict
62
65
>>>list(loc_a_codes.keys())
63
-
['A', 'Additional notes', 'Last updated date']
66
+
['A', 'Notes', 'Last updated date']
64
67
65
68
As shown above, ``loc_a_codes`` is a `dictionary`_ (i.e. in `dict`_ format) with the following *keys*:
66
69
67
70
- ``'A'``
68
-
- ``'Additional notes'``
71
+
- ``'Notes'``
69
72
- ``'Last updated date'``
70
73
71
74
The corresponding *values* are:
72
75
73
76
- ``loc_a_codes['A']`` - CRS, NLC, TIPLOC and STANOX codes for the locations whose names begin with ``'A'``, referring to the table on the `Locations beginning A`_ web page.
74
-
- ``loc_a_codes['Additional notes']`` - Any additional information provided on the web page (if available).
77
+
- ``loc_a_codes['Notes']`` - Any additional information provided on the web page (if available).
75
78
- ``loc_a_codes['Last updated date']`` - The date when the `Locations beginning A`_ web page was last updated.
76
79
77
80
A snapshot of the data contained in ``loc_a_codes`` is demonstrated below:
@@ -89,8 +92,14 @@ A snapshot of the data contained in ``loc_a_codes`` is demonstrated below:
Similar to location identifiers, the ELR codes on the `Railway Codes`_ website are arranged alphabetically based on their initial letters. We can use the :meth:`ELRMileages.collect_elr_by_initial()<pyrcs.line_data.ELRMileages.collect_elr_by_initial>` method to obtain ELRs starting with a specific letter. For example, to get the data for ELRs beginning with the letter ``'A'``:
222
+
Similar to location identifiers, the ELR codes on the `Railway Codes`_ website are arranged alphabetically based on their initial letters. We can use the :meth:`ELRMileages.collect_elr()<pyrcs.line_data.ELRMileages.collect_elr>` method to obtain ELRs starting with a specific letter. For example, to get the data for ELRs beginning with the letter ``'A'``:
To retrieve data for all ELRs (from ``'A'`` to ``'Z'``), we can use the :meth:`ELRMileages.fetch_elr()<pyrcs.line_data.ELRMileages.fetch_elr>` method:
247
264
@@ -279,6 +296,10 @@ Here is a snapshot of the data contained in ``elrs_codes``:
279
296
4579ZZZ9 Dummy ELRfor demonstrations and testing ... n/a
280
297
[5 rows x 5 columns]
281
298
299
+
>>>## Try more examples! Uncomment the lines below and run:
300
+
>>># elrs_a_codes = em.fetch_elr(initial='a') # Fetch ELRs starting with 'A'
301
+
>>># elrs_b_codes = em.fetch_elr(initial='B') # Fetch ELRs starting with 'B'
302
+
282
303
.. _quickstart-mileage-file-of-a-given-elr:
283
304
284
305
Mileage file of a given ELR
@@ -327,6 +348,9 @@ Here is a snapshot of the data contained in ``amm_mileage_file``:
327
348
41.1408...
328
349
[5 rows x 11 columns]
329
350
351
+
>>>## Try more examples! Uncomment the lines below and run:
352
+
>>># xre_mileage_file = em.fetch_mileage_file('XRE') # Fetch mileage file for 'XRE'
353
+
>>># your_mileage_file = em.fetch_mileage_file(elr='?') # ... and for a given ELR '?'
330
354
331
355
.. _quickstart-railway-station-data:
332
356
@@ -369,11 +393,14 @@ Alternatively, we can also create the instance by using the :class:`~pyrcs.colle
369
393
Railway stations by initial letter
370
394
----------------------------------
371
395
372
-
We can obtain railway station data based on the first letter (e.g. ``'A'`` or ``'Z'``) of the station's name using the :meth:`Stations.collect_locations_by_initial()<pyrcs.other_assets.Stations.collect_locations_by_initial>` method. For example, to get data for stations starting with ``'A'``:
396
+
We can obtain railway station data based on the first letter (e.g. ``'A'`` or ``'Z'``) of the station's name using the :meth:`Stations.collect_locations()<pyrcs.other_assets.Stations.collect_locations>` method. For example, to get data for stations starting with ``'A'``:
0 commit comments