bsrn.dataset.BSRNDataset.average#

BSRNDataset.average(freq, alignment='ceiling', aggfunc='mean', match_ceiling_labels=True)[source]#

Time-average the cached data() with explicit labeled windows.

Delegates to pretty_average() and replaces the internal cache with the returned frame (new index).

Native timestep for center windows is taken from self.resolution (minutes) when set; otherwise passed as None for pretty_average() to infer.

Parameters:
  • freq (str) – Fixed bin frequency (e.g. '1h', '30min').

  • alignment ({'floor', 'ceiling', 'center'}, optional) – Window alignment (default 'ceiling').

  • aggfunc (str or callable, optional) – Aggregation function (default 'mean').

  • match_ceiling_labels (bool, optional) – When alignment='center', monthly edge trim style (default True, ceiling-like).

Returns:

One row per output label; also stored as the new cache.

Return type:

pandas.DataFrame

Raises: