sktime_datetime_freq
Helpers for sktime ForecastingHorizon when series indices have no pandas freq.
infer_pandas_freq_offset_for_datetime_index(index)
Return a pandas offset so sktime ForecastingHorizon can call to_absolute.
NIFTY / stocks-style covariate series often use a DatetimeIndex with no .freq and no pd.infer_freq result (irregular gaps). sktime then leaves fh.freq as None and predict raises int * NoneType in _to_offset.
| Parameter | Type | Default | Description |
|---|---|---|---|
| index | pd.DatetimeIndex |
- | (undocumented) |
Returns: A pandas offset object.
Raises:
* TypeError: If index is not pd.DatetimeIndex.
* ValueError: If the index is empty, or if frequency cannot be inferred (e.g., index length < 2 when no freq is present, or median timestamp delta is NaT).