重新取樣#

pandas.api.typing.Resampler 執行個體由重新取樣呼叫傳回: pandas.DataFrame.resample()pandas.Series.resample()

索引、反覆運算#

Resampler.__iter__()

群組反覆運算器。

Resampler.groups

字典 {群組名稱 -> 群組標籤}。

Resampler.indices

字典 {群組名稱 -> 群組索引}。

Resampler.get_group(name[, obj])

使用提供的名稱從群組建構 DataFrame。

函數應用#

Resampler.apply([func])

使用一個或多個作業在指定的軸向上匯總。

Resampler.aggregate([func])

使用一個或多個作業在指定的軸向上匯總。

Resampler.transform(arg, *args, **kwargs)

呼叫函數,在每個群組上產生一個類似索引的 Series。

Resampler.pipe(func, *args, **kwargs)

將一個 func 與參數套用於此 Resampler 物件,並傳回其結果。

向上取樣#

Resampler.ffill([limit])

向前填入值。

Resampler.bfill([limit])

向後填入重新取樣資料中的新遺失值。

Resampler.nearest([limit])

使用最近的值重新取樣。

Resampler.fillna(method[, limit])

填入向上取樣所產生的遺失值。

Resampler.asfreq([fill_value])

傳回新頻率的值,基本上就是重新索引。

Resampler.interpolate([method, axis, limit, ...])

根據不同的方法,對目標時間戳記之間的值進行插值。

計算/描述性統計資料#

Resampler.count()

計算群組的數量,不包括遺失值。

Resampler.nunique(*args, **kwargs)

傳回群組中唯一元素的數量。

Resampler.first([numeric_only, min_count, ...])

計算每個群組中每個欄位的第 1 個項目。

Resampler.last([numeric_only, min_count, skipna])

計算每個群組中每個欄位的最後一個項目。

Resampler.max([numeric_only, min_count])

計算群組的最大值。

Resampler.mean([numeric_only])

計算群組的平均值,不包括遺失值。

Resampler.median([numeric_only])

計算群組的中位數,不包括遺失值。

Resampler.min([numeric_only, min_count])

計算群組的最小值。

Resampler.ohlc(*args, **kwargs)

計算一組的開盤、最高、最低和收盤值,不包括遺失值。

Resampler.prod([numeric_only, min_count])

計算組值的乘積。

Resampler.size()

計算組大小。

Resampler.sem([ddof, numeric_only])

計算組平均數的標準誤差,不包括遺失值。

Resampler.std([ddof, numeric_only])

計算組的標準差,不包括遺失值。

Resampler.sum([numeric_only, min_count])

計算組值的總和。

Resampler.var([ddof, numeric_only])

計算組的變異數,不包括遺失值。

Resampler.quantile([q])

在給定的分位數處傳回值。