energy_analysis_toolbox.energy.resample#

Function to resample a energy series.

energy_analysis_toolbox.energy.resample.to_freq(series: pd.Series[float], freq: str, origin: None | Literal['floor', 'ceil'] | Timestamp = None, last_step_duration: float | None = None) pd.Series[float][source]#

Resample an energy series to a given frequency.

The last step duration of the resampled series is set to the frequency freq.

Parameters:
  • series (pd.Series[float]) – a series of energy.

  • freq (str) – the frequency to resample to.

  • origin ({"floor", "ceil", pd.Timestamp}, optional) – the origin of the resampling, by default None. See flow_rate_to_freq for more details.

  • last_step_duration (float, optional) – Duration of the last time-step in the volume series in (s). The default is None in which case the duration of the former-last time-step is used. See flow_rate_to_freq for more details.

Returns:

pd.Series[float] – the resampled energy series.

See also

  • energy_analysis_toolbox.timeseries.resample. conservative.volume_to_freq

  • energy_analysis_toolbox.timeseries.resample. conservative.volume_conservative