dsipts.data_management.monash module

dsipts.data_management.monash.convert_tsf_to_dataframe(full_file_path_and_name, replace_missing_vals_with='NaN', value_column_name='series_value')[source]

I copied this function from the repo

Parameters:
  • full_file_path_and_name (str) – path

  • replace_missing_vals_with (str, optional) – replace not valid numbers. Defaults to “NaN”.

  • value_column_name (str, optional) – . Defaults to “series_value”.

Raises:

Exception – see https://forecastingdata.org/ for more information

Returns:

the selected timserie

Return type:

pd.DataFrame

dsipts.data_management.monash.get_freq(freq)[source]

Get the frequency based on the string reported. I don’t think there are all the possibilities here

Parameters:

freq (str) – string coming from

Returns:

pandas frequency format

Return type:

str

class dsipts.data_management.monash.Monash(filename, baseUrl='https://forecastingdata.org/', rebuild=False)[source]

Bases: object

Class for downloading datasets listed here https://forecastingdata.org/

Parameters:
  • filename (str) – name of the class, used for saving

  • baseUrl (str, optional) – url to the source page. Defaults to ‘https://forecastingdata.org/’.

  • rebuild (bool, optional) – if true the table will be loaded from the webpage otherwise it will be loaded from the saved file. Defaults to False.

__init__(filename, baseUrl='https://forecastingdata.org/', rebuild=False)[source]

Class for downloading datasets listed here https://forecastingdata.org/

Parameters:
  • filename (str) – name of the class, used for saving

  • baseUrl (str, optional) – url to the source page. Defaults to ‘https://forecastingdata.org/’.

  • rebuild (bool, optional) – if true the table will be loaded from the webpage otherwise it will be loaded from the saved file. Defaults to False.

save(filename)[source]

Save the monarch structure

Parameters:

filename (str) – name of the file to generate

load(filename)[source]

Load a monarch structure

Parameters:

filename (str) – filename to load

download_dataset(path, id, rebuild=False)[source]

download a specific dataset

Parameters:
  • path (str) – path in which save the data

  • id (int) – id of the dataset

  • rebuild (bool, optional) – if true the dataset will be re-downloaded. Defaults to False.

generate_dataset(id)[source]

Parse the id-th dataset in a convient format and return a pandas dataset

Parameters:

id (int) – id of the dataset

Returns:

dataframe

Return type:

None or pd.DataFrame