pywrdrb.utils.timeseries.subset_timeseries

pywrdrb.utils.timeseries.subset_timeseries#

pywrdrb.utils.timeseries.subset_timeseries(timeseries, start_date, end_date, end_inclusive=True)#

Take a subset of pd.Series timeseries data between start_date and end_date.

Parameters:
  • timeseries (pd.Series) – The timeseries data to subset.

  • start_date (str or pd.Timestamp) – The start date for the subset. If str, should be in ‘YYYY-MM-DD’ format.

  • end_date (str or pd.Timestamp) – The end date for the subset. If str, should be in ‘YYYY-MM-DD’ format.

  • end_inclusive (bool, optional) – Whether to include the end date in the subset. Default is True.

Returns:

The subset of the timeseries data between start_date and end_date.

Return type:

pd.Series