Pandas Window对象

生成window对象

.rolling calls:pandas.DataFrame.rolling(),pandas.Series.rolling()
.expanding
calls:pandas.DataFrame.expanding(),pandas.Series.expanding()
.ewm calls: pandas.DataFrame.ewm(), pandas.Series.ewm()
例如数据框DataFrame的window对象生成
DataFrame.rolling(window, min_periods=None, freq=None, center=False, win_type=None, on=None, axis=0)
window:窗口的长度
min_periods=窗口移动最小的间隔,默认为1
center:是否在中间位置显示计算值,默认为Flase
win_type:
on:指定窗口移动的列,默认为索引列
axis:指定窗口移动方向
标准移动窗口函数:

Function Describe
Rolling.count() rolling count of number of non-NaN
Rolling.sum(*args,?**kwargs) rolling sum
Rolling.mean(*args,?**kwargs) rolling mean
Rolling.median(**kwargs) rolling median
Rolling.var([ddof]) rolling variance
Rolling.std([ddof]) rolling standard deviation
Rolling.min(*args,?**kwargs) rolling minimum
Rolling.max(*args,?**kwargs) rolling maximum
Rolling.corr([other,?pairwise]) rolling sample correlation
Rolling.cov([other,?pairwise,?ddof]) rolling sample covariance
Rolling.skew(**kwargs) Unbiased rolling skewness
Rolling.kurt(**kwargs) Unbiased rolling kurtosis
Rolling.apply(func[,?args,?kwargs]) rolling function apply
Rolling.quantile(quantile,?**kwargs) rolling quantile
Window.mean(*args,?**kwargs) window mean
Window.sum(*args,?**kwargs) window sum

标准扩展窗口:

Function Describe
Expanding.count(**kwargs) expanding count of number of non-NaN
Expanding.sum(*args,?**kwargs) expanding sum
Expanding.mean(*args,?**kwargs) expanding mean
Expanding.median(**kwargs) expanding median
Expanding.var([ddof]) expanding variance
Expanding.std([ddof]) expanding standard deviation
Expanding.min(*args,?**kwargs) expanding minimum
Expanding.max(*args,?**kwargs) expanding maximum
Expanding.corr([other,?pairwise]) expanding sample correlation
Expanding.cov([other,?pairwise,?ddof]) expanding sample covariance
Expanding.skew(**kwargs) Unbiased expanding skewness
Expanding.kurt(**kwargs) Unbiased expanding kurtosis
Expanding.apply(func[,?args,?kwargs]) expanding function apply
Expanding.quantile(quantile,?**kwargs) expanding quantile

指数权重移动窗口:

Function Describe
EWM.mean(*args,?**kwargs) exponential weighted moving average
EWM.std([bias]) exponential weighted moving stddev
EWM.var([bias]) exponential weighted moving variance
EWM.corr([other,?pairwise]) exponential weighted sample correlation
EWM.cov([other,?pairwise,?bias]) exponential weighted sample covariance

你可能感兴趣的:(pandas)