Skip to main content
TimeGPT accepts pandas and polars dataframes in long format. The minimum required columns are:

Required Columns

  • unique_id: String or numerical value to label each series.
  • ds(timestamp): String or datetime in YYYY-MM-DD or YYYY-MM-DD HH:MM:SS format.
  • y(numeric): Numerical target variable to forecast.

Optional Index

If a DataFrame lacks the ds column but uses a DatetimeIndex, that is also supported.
TimeGPT also supports distributed dataframe libraries such as dask, spark, and ray.
Open In Colab
You can include additional exogenous features in the same DataFrame. See the Exogenous Variables tutorial for details.

Example DataFrame

Below is a sample of a valid input DataFrame for TimeGPT (with columns named timestamp and value instead of ds and y):
Sample Data Loading

Data Preview

Sample Data Preview
In this example:
  • unique_id identifies the series
  • timestamp corresponds to ds.
  • value corresponds to y.

Matching Columns to TimeGPT

You can choose how to align your DataFrame columns with TimeGPT’s expected structure:
Rename timestamp to ds and value to y:
Rename Columns Example
Now your DataFrame has the explicitly required columns:
Show Head of DataFrame

Example Forecast

When you run the forecast method:
Forecast Example
Forecast Logs

Forecast Output Preview

TimeGPT attempts to automatically infer your data’s frequency (freq). You can override this by specifying the freq parameter (e.g., freq='MS').
For more information, see the TimeGPT Quickstart.

Important Considerations

Warning: Data passed to TimeGPT must not contain missing values or time gaps.
To handle missing data, see Dealing with Missing Values in TimeGPT.

Minimum Data Requirements (Azure AI)

These are the minimum data sizes required for each frequency when using Azure AI:
When preparing your data, also consider:
1

Forecast horizon (h)

Number of future periods you want to predict.
2

Number of validation windows (n_windows)

How many times to test the model’s performance.
3

Gaps (step_size)

Periodic offset between validation windows during cross-validation.
This ensures you have enough data for both training and evaluation.