Viaducts.collect_viaduct_codes_by_page

Viaducts.collect_viaduct_codes_by_page(page_no, update=False, verbose=False)

Collect data of railway viaducts for a given page number from source web page.

Parameters
  • page_no (int or str) – page number; valid values include 1, 2, 3, 4, 5, and 6

  • update (bool) – whether to do an update check (for the package data), defaults to False

  • verbose (bool or int) – whether to print relevant information in console, defaults to False

Returns

data of railway viaducts on page page_no and date of when the data was last updated

Return type

dict

Example:

>>> from pyrcs.other_assets import Viaducts

>>> vdct = Viaducts()

>>> # vd1 = vdct.collect_viaduct_codes_by_page(1, update=True, verbose=True)
>>> vd1 = vdct.collect_viaduct_codes_by_page(page_no=1)

>>> type(vd1)
dict
>>> list(vd1.keys())
['Page 1 (A-C)', 'Last updated date']

>>> viaducts_1 = vd1['Page 1 (A-C)']

>>> type(viaducts_1)
pandas.core.frame.DataFrame
>>> viaducts_1.head()
            Name  ... Spans
0       7 Arches  ...     7
1        36 Arch  ...    36
2        42 Arch  ...
3           A698  ...     5
4  Abattoir Road  ...     8
[5 rows x 7 columns]