def create_timeseries(starting_date, ending_date, value=0):
"""Create a Pandas Time Series with constant values.
Attributes
----------
starting_date: str, pandas.tslib.Timestamp
The first date of the Time Series.
ending_date: str, pandas.tslib.Timestamp
The last date of the Time Series.
value: int,float
Value to add to new entries. Default is zero.
"""
timeseries_index = pd.date_range(starting_date, ending_date)
timeseries = pd.Series(value, index=timeseries_index)
return timeseries
评论列表
文章目录