TimeSeriesDataFrame.from_path

classmethod TimeSeriesDataFrame.from_path(path: str | Path, id_column: str | None = None, timestamp_column: str | None = None, static_features_path: str | Path | None = None) TimeSeriesDataFrame[source]

Construct a TimeSeriesDataFrame from a CSV or Parquet file.

Parameters:
  • path (str or pathlib.Path) –

    Path to a local or remote (e.g., S3) file containing the time series data in CSV or Parquet format. Example file contents:

    item_id,timestamp,target
    0,2019-01-01,0
    0,2019-01-02,1
    0,2019-01-03,2
    1,2019-01-01,3
    1,2019-01-02,4
    1,2019-01-03,5
    2,2019-01-01,6
    2,2019-01-02,7
    2,2019-01-03,8
    

  • id_column (str, optional) – Name of the ‘item_id’ column if column name is different

  • timestamp_column (str, optional) – Name of the ‘timestamp’ column if column name is different

  • static_features_path (str or pathlib.Path, optional) –

    Path to a local or remote (e.g., S3) file containing static features in CSV or Parquet format. Example file contents:

    item_id,feat_1,feat_2
    0,foo,0.5
    1,foo,2.2
    2,bar,0.1
    

Returns:

ts_df – A data frame in TimeSeriesDataFrame format.

Return type:

TimeSeriesDataFrame