solarforecastarbiter.io.utils.adjust_timeseries_for_interval_label

solarforecastarbiter.io.utils.adjust_timeseries_for_interval_label(data, interval_label, start, end)[source]

Adjusts the index of the data depending on the interval_label, start, and end. Will always return the data located between start, end.

Parameters:
  • data (pandas.Series or pandas.DataFrame) – The data with a localized DatetimeIndex
  • interval_label (str or None) – The interval label for the the object the data represents
  • start (pandas.Timestamp) – Start time to restrict data to
  • end (pandas.Timestamp) – End time to restrict data to
Returns:

pandas.Series or pandas.DataFrame – Return data between start and end, in/excluding the endpoints depending on interval_label

Raises:

ValueError – If an invalid interval_label is given or data is not localized.