WaterTroughs.fetch_codes

WaterTroughs.fetch_codes(update=False, dump_dir=None, verbose=False, **kwargs)[source]

Fetches codes of water troughs locations.

Parameters:
  • update (bool) – Whether to check for updates to the package data; defaults to False.

  • dump_dir (str | None) – The path to a directory where the data file will be saved; defaults to None.

  • verbose (bool | int) – Whether to print relevant information to the console; defaults to False.

Returns:

A dictionary containing the codes of water trough locations and the date they were last updated.

Return type:

dict

Examples:

>>> from pyrcs.other_assets import WaterTroughs  # from pyrcs import WaterTroughs

>>> wt = WaterTroughs()

>>> wt_codes = wt.fetch_codes()
>>> type(wt_codes)
dict
>>> list(wt_codes)
['Water troughs', 'Last updated date']

>>> wt.KEY
'Water troughs'

>>> wt_codes_dat = wt_codes['Water troughs']
>>> type(wt_codes_dat)
pandas.DataFrame
>>> wt_codes_dat.shape
(99, 6)
>>> wt_codes_dat.head()
     ELR  ... Length (Yard)
0    BEI  ...           NaN
1    BHL  ...        620.00
42  CGJ2  ...        506.67
41  CGJ2  ...        506.67
2   CGJ6  ...        561.00
[5 rows x 6 columns]