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.使用显式标签窗对缓存的
data()做时间平均。Delegates to
pretty_average()and replaces the internal cache with the returned frame (new index).委托
pretty_average(),并以返回帧**替换** 内部缓存(新索引)。Native timestep for center windows is taken from
self.resolution(minutes) when set; otherwise passed asNoneforpretty_average()to infer.center 窗的原生步长取自
self.resolution``(分钟);未设置时传 ``None由pretty_average()推断。- Parameters:
freq (str) – Fixed bin frequency (e.g.
'1h','30min'). 固定分箱频率。alignment ({'floor', 'ceiling', 'center'}, optional) – Window alignment (default
'ceiling'). 窗对齐方式(默认'ceiling')。aggfunc (str or callable, optional) – Aggregation function (default
'mean'). 聚合函数(默认'mean')。match_ceiling_labels (bool, optional) – When
alignment='center', monthly edge trim style (defaultTrue, ceiling-like).alignment='center'时的月界裁剪方式(默认True,类 ceiling)。
- Returns:
One row per output label; also stored as the new cache.
- Return type:
- Raises:
TypeError – If
data().indexis not aDatetimeIndex.data()索引非DatetimeIndex时。ValueError – Propagated from
pretty_average()whenfreqis not a fixed frequency.freq非固定频率等由pretty_average抛出。