TimeSeriesDataFrame.from_iterable_dataset#

classmethod TimeSeriesDataFrame.from_iterable_dataset(iterable_dataset: Iterable) DataFrame[source]#

Construct a TimeSeriesDataFrame from an Iterable of dictionaries each of which represent a single time series.

This function also offers compatibility with GluonTS data sets, see https://ts.gluon.ai/_modules/gluonts/dataset/common.html#ListDataset.

Parameters

iterable_dataset (Iterable) –

An iterator over dictionaries, each with a target field specifying the value of the (univariate) time series, and a start field that features a pandas Timestamp with features. Example:

iterable_dataset = [
    {"target": [0, 1, 2], "start": pd.Timestamp("01-01-2019", freq='D')},
    {"target": [3, 4, 5], "start": pd.Timestamp("01-01-2019", freq='D')},
    {"target": [6, 7, 8], "start": pd.Timestamp("01-01-2019", freq='D')}
]

Returns

ts_df – A data frame in TimeSeriesDataFrame format.

Return type

TimeSeriesDataFrame