Documentation Index
Fetch the complete documentation index at: https://nixtlaverse.nixtla.io/llms.txt
Use this file to discover all available pages before exploring further.
id_time_grid
id_time_grid(df, freq, start='per_serie', end='global', id_col='unique_id', time_col='ds')
Generate all expected combiations of ids and times.
Parameters:
| Name | Type | Description | Default |
|---|
df | pandas or polars DataFrame | Input data | required |
freq | str or int | Series’ frequency | required |
start | (str, int, date or datetime) | Initial timestamp for the series. * ‘per_serie’ uses each serie’s first timestamp * ‘global’ uses the first timestamp seen in the data * Can also be a specific timestamp or integer, e.g. ‘2000-01-01’, 2000 or datetime(2000, 1, 1) Defaults to “per_serie”. | ‘per_serie’ |
end | (str, int, date or datetime) | Initial timestamp for the series. * ‘per_serie’ uses each serie’s last timestamp * ‘global’ uses the last timestamp seen in the data * Can also be a specific timestamp or integer, e.g. ‘2000-01-01’, 2000 or datetime(2000, 1, 1) Defaults to “global”. | ‘global’ |
id_col | str | Column that identifies each serie. Defaults to ‘unique_id’. | ‘unique_id’ |
time_col | str | Column that identifies each timestamp. Defaults to ‘ds’. | ‘ds’ |
Returns:
| Type | Description |
|---|
DFType | pandas or polars DataFrame: Dataframe with expected ids and times. |
fill_gaps
fill_gaps(df, freq, start='per_serie', end='global', id_col='unique_id', time_col='ds')
Enforce start and end datetimes for dataframe.
Parameters:
| Name | Type | Description | Default |
|---|
df | pandas or polars DataFrame | Input data | required |
freq | str or int | Series’ frequency | required |
start | (str, int, date or datetime) | Initial timestamp for the series. * ‘per_serie’ uses each serie’s first timestamp * ‘global’ uses the first timestamp seen in the data * Can also be a specific timestamp or integer, e.g. ‘2000-01-01’, 2000 or datetime(2000, 1, 1) Defaults to “per_serie”. | ‘per_serie’ |
end | (str, int, date or datetime) | Initial timestamp for the series. * ‘per_serie’ uses each serie’s last timestamp * ‘global’ uses the last timestamp seen in the data * Can also be a specific timestamp or integer, e.g. ‘2000-01-01’, 2000 or datetime(2000, 1, 1) Defaults to “global”. | ‘global’ |
id_col | str | Column that identifies each serie. Defaults to ‘unique_id’. | ‘unique_id’ |
time_col | str | Column that identifies each timestamp. Defaults to ‘ds’. | ‘ds’ |
Returns:
| Type | Description |
|---|
DFType | pandas or polars DataFrame: Dataframe with gaps filled. |