The function make_future_timeseries takes a pandas Series or DateTimeIndex and generates a future sequence of dates based on the frequency of the input series.
Parameters
Name
Type
Description
Default
idx
pd.Series or pd.DateTimeIndex
The idx parameter is the input time series data. It can be either a pandas Series or a pandas DateTimeIndex. It represents the existing dates in the time series.
required
length_out
int
The parameter length_out is an integer that represents the number of future dates to generate for the time series.
required
freq
str or pd.DateOffset
Frequency of the future dates. When None, the cadence is inferred from the input data (respecting force_regular). Accepts pandas offsets or human-friendly strings e.g. "2 weeks".
None
force_regular
bool
The force_regular parameter is a boolean flag that determines whether the frequency of the future dates should be forced to be regular. If force_regular is set to True, the frequency of the future dates will be forced to be regular. If force_regular is set to False, the frequency of the future dates will be inferred from the input data (e.g. business calendars might be used). The default value is False.
False
Returns
Name
Type
Description
pd.Series
A pandas Series object containing future dates.
Examples
import pandas as pdimport pytimetk as tk# Works with a single date (must provide a length out and frequency if only# 1 date is provided)tk.make_future_timeseries("2011-01-01", 5, "D")