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
The frequency parameter is a string that specifies the frequency of the future dates. If frequency is set to None, the frequency of the future dates will be inferred from the input data (e.g. business calendars might be used). The default value is None.
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
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")