LOR.get_keys_to_prefixes
- LOR.get_keys_to_prefixes(prefixes_only=True, update=False, verbose=False)
Get the keys to PRIDE/LOR code prefixes.
- Parameters
prefixes_only (bool) – whether to get only prefixes, defaults to
True
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
True
- Returns
keys to LOR code prefixes
- Return type
list or dict or None
Examples:
>>> from pyrcs.line_data import LOR # from pyrcs import LOR >>> lor = LOR() >>> keys_to_pfx = lor.get_keys_to_prefixes() >>> keys_to_pfx ['CY', 'EA', 'GW', 'LN', 'MD', 'NW', 'NZ', 'SC', 'SO', 'SW', 'XR'] >>> keys_to_pfx = lor.get_keys_to_prefixes(prefixes_only=False) >>> type(keys_to_pfx) dict >>> list(keys_to_pfx.keys()) ['Key to prefixes', 'Last updated date'] >>> keys_to_pfx_codes = keys_to_pfx['Key to prefixes'] >>> type(keys_to_pfx_codes) pandas.core.frame.DataFrame >>> keys_to_pfx_codes.head() Prefixes Name 0 CY Wales 1 EA South Eastern: East Anglia area 2 GW Great Western (later known as Western) 3 LN London & North Eastern 4 MD North West: former Midlands lines