autots.datasets package

Submodules

autots.datasets.fred module

FRED (Federal Reserve Economic Data) Data Import

requires API key from FRED and pip install fredapi

autots.datasets.fred.get_fred_data(fredkey: str, SeriesNameDict: dict = None, long=True, **kwargs)

Imports Data from Federal Reserve. For simplest results, make sure requested series are all of the same frequency.

Parameters
  • fredkey (str) – an API key from FRED

  • SeriesNameDict (dict) – pairs of FRED Series IDs and Series Names like: {‘SeriesID’: ‘SeriesName’} or a list of FRED IDs. Series id must match Fred IDs, but name can be anything if None, several default series are returned

  • long (bool) – if True, return long style data, else return wide style data with dt index

Module contents

Tools for Importing Sample Data

autots.datasets.load_daily(long: bool = True)

2020 Covid, Air Pollution, and Economic Data.

Sources: Covid Tracking Project, EPA, and FRED

Parameters

long (bool) – if True, return data in long format. Otherwise return wide

autots.datasets.load_monthly(long: bool = True)

Federal Reserve of St. Louis monthly economic indicators.

autots.datasets.load_yearly(long: bool = True)

Federal Reserve of St. Louis annual economic indicators.

autots.datasets.load_hourly(long: bool = True)

Traffic data from the MN DOT via the UCI data repository.

autots.datasets.load_weekly(long: bool = True)

Weekly petroleum industry data from the EIA.

autots.datasets.load_weekdays(long: bool = False, categorical: bool = True, periods: int = 180)

Test edge cases by creating a Series with values as day of week.

Parameters
  • long (bool) – if True, return a df with columns “value” and “datetime” if False, return a Series with dt index

  • categorical (bool) – if True, return str/object, else return int

  • periods (int) – number of periods, ie length of data to generate

autots.datasets.load_live_daily(long: bool = False, fred_key: str = None, fred_series: list = ['DGS10', 'T5YIE', 'SP500', 'DCOILWTICO', 'DEXUSEU'], tickers: list = ['MSFT'], trends_list: list = ['forecasting', 'cycling', 'cpu', 'microsoft'], weather_data_types: list = ['AWND', 'WSF2', 'TAVG'], weather_stations: list = ['USW00094846', 'USW00014925'], weather_years: int = 10, london_air_stations: list = ['CT3', 'SK8'], london_air_species: str = 'PM25', london_air_days: int = 180, earthquake_days: int = 180, earthquake_min_magnitude: int = 5)

Generates a dataframe of data up to the present day.

Parameters
  • long (bool) – whether to return in long format or wide

  • fred_key (str) – https://fred.stlouisfed.org/docs/api/api_key.html

  • fred_series (list) – list of FRED series IDs. This requires fredapi package

  • tickers (list) – list of stock tickers, requires yfinance

  • trends (list) – list of search keywords, requires pytrends.

  • weather_data_types (list) – from NCEI NOAA api data types, GHCN Daily Weather Elements PRCP, SNOW, TMAX, TMIN, TAVG, AWND, WSF1, WSF2, WSF5, WSFG

  • weather_stations (list) – from NCEI NOAA api station ids

  • london_air_stations (list) – londonair.org.uk source station IDs

  • london_species (str) – what measurement to pull from London Air. Not all stations have all metrics. earthquake_min_magnitude (int): smallest earthquake magnitude to pull from earthquake.usgs.gov