load_from_tsf_file¶
- load_from_tsf_file(full_file_path_and_name, replace_missing_vals_with='NaN', value_column_name='series_value', return_type='tsf_default')[source]¶
Convert the contents in a .tsf file into a dataframe.
This code was extracted from https://github.com/rakshitha123/TSForecasting/blob/master/utils/data_loader.py.
- Parameters:
- full_file_path_and_namestr
The full path to the .tsf file.
- replace_missing_vals_withstr, default=”NAN”
A term to indicate the missing values in series in the returning dataframe.
- value_column_namestr, default=”series_value”
Any name that is preferred to have as the name of the column containing series values in the returning dataframe.
- return_typestr - “pd_multiindex_hier” or “tsf_default” (default)
- “tsf_default” = container that faithfully mirrors tsf format from the original
implementation in: https://github.com/rakshitha123/TSForecasting/ blob/master/utils/data_loader.py.
- Returns:
- loaded_datapd.DataFrame
The converted dataframe containing the time series.
- metadatadict
The metadata for the forecasting problem. The dictionary keys are: “frequency”, “forecast_horizon”, “contain_missing_values”, “contain_equal_length”
- Raises:
- URLError or HTTPError
If the website is not accessible.
- ValueError
If a dataset name that does not exist on the repo is given or if a webpage is requested that does not exist.