pub struct Expanding<'a> { /* private fields */ }Expand description
Expanding window aggregation over a Series.
Created by Series::expanding(). All prior elements are included
in each window computation.
Implementations§
Source§impl Expanding<'_>
impl Expanding<'_>
Sourcepub fn sum(&self) -> Result<Series, FrameError>
pub fn sum(&self) -> Result<Series, FrameError>
Expanding sum.
Matches pd.Series.expanding(min_periods).sum(). Empty
windows (no non-missing values observed yet) emit Null(NaN)
when min_periods >= 1; if the caller explicitly sets
min_periods=0 an empty window still returns 0.0 (pandas
conventional empty-sum identity).
Sourcepub fn mean(&self) -> Result<Series, FrameError>
pub fn mean(&self) -> Result<Series, FrameError>
Expanding mean.
Matches pd.Series.expanding(min_periods).mean(). Empty
windows return Null(NaN) regardless of min_periods — mean
of an empty set is undefined (pandas emits NaN, not 0/0).
Sourcepub fn min(&self) -> Result<Series, FrameError>
pub fn min(&self) -> Result<Series, FrameError>
Expanding minimum.
Sourcepub fn max(&self) -> Result<Series, FrameError>
pub fn max(&self) -> Result<Series, FrameError>
Expanding maximum.
Sourcepub fn std(&self) -> Result<Series, FrameError>
pub fn std(&self) -> Result<Series, FrameError>
Expanding sample standard deviation (ddof=1).
Sourcepub fn var(&self) -> Result<Series, FrameError>
pub fn var(&self) -> Result<Series, FrameError>
Expanding sample variance (ddof=1).
Sourcepub fn median(&self) -> Result<Series, FrameError>
pub fn median(&self) -> Result<Series, FrameError>
Expanding median.
Sourcepub fn apply<F>(&self, func: F) -> Result<Series, FrameError>
pub fn apply<F>(&self, func: F) -> Result<Series, FrameError>
Apply a custom function over the expanding window.
Matches series.expanding().apply(func).
Sourcepub fn count(&self) -> Result<Series, FrameError>
pub fn count(&self) -> Result<Series, FrameError>
Expanding count of non-null values.
Matches series.expanding().count().
Sourcepub fn quantile(&self, q: f64) -> Result<Series, FrameError>
pub fn quantile(&self, q: f64) -> Result<Series, FrameError>
Expanding quantile.
Matches series.expanding().quantile(q).
Sourcepub fn skew(&self) -> Result<Series, FrameError>
pub fn skew(&self) -> Result<Series, FrameError>
Expanding skewness (bias=False, Fisher’s definition).
Matches pd.Series.expanding().skew().
Sourcepub fn kurt(&self) -> Result<Series, FrameError>
pub fn kurt(&self) -> Result<Series, FrameError>
Expanding excess kurtosis (Fisher’s definition, bias=False).
Matches pd.Series.expanding().kurt().
Sourcepub fn kurtosis(&self) -> Result<Series, FrameError>
pub fn kurtosis(&self) -> Result<Series, FrameError>
Alias for kurt() — pandas exposes both spellings on
Series.expanding aggregations.
Sourcepub fn corr(&self, other: &Series) -> Result<Series, FrameError>
pub fn corr(&self, other: &Series) -> Result<Series, FrameError>
Expanding Pearson correlation with another Series.
Matches pd.Series.expanding().corr(other). At each position,
correlates all prior (and current) aligned pairs that have non-null
numeric values in both series. Returns NaN until min_periods and
at least two valid pairs are observed, and when either sample
standard deviation is zero.
Sourcepub fn cov(&self, other: &Series) -> Result<Series, FrameError>
pub fn cov(&self, other: &Series) -> Result<Series, FrameError>
Expanding sample covariance (ddof=1) with another Series.
Matches pd.Series.expanding().cov(other). At each position, the
covariance is computed over all aligned pairs where both values
are non-null and numeric.
Sourcepub fn sem(&self) -> Result<Series, FrameError>
pub fn sem(&self) -> Result<Series, FrameError>
Expanding standard error of the mean.
Matches series.expanding().sem().
Sourcepub fn rank(
&self,
method: &str,
ascending: bool,
na_option: &str,
) -> Result<Series, FrameError>
pub fn rank( &self, method: &str, ascending: bool, na_option: &str, ) -> Result<Series, FrameError>
Rank the current observation against all observations seen so far.
Matches series.expanding().rank().
Sourcepub fn agg(&self, funcs: &[&str]) -> Result<DataFrame, FrameError>
pub fn agg(&self, funcs: &[&str]) -> Result<DataFrame, FrameError>
Aggregate with multiple functions, returning a DataFrame.
Matches series.expanding().agg(['sum', 'mean']).
Sourcepub fn aggregate(&self, funcs: &[&str]) -> Result<DataFrame, FrameError>
pub fn aggregate(&self, funcs: &[&str]) -> Result<DataFrame, FrameError>
pandas alias for Self::agg.
Matches series.expanding().aggregate([...]).
Sourcepub fn exclusions(&self) -> Vec<String>
pub fn exclusions(&self) -> Vec<String>
Frozenset-style label set excluded from this expanding window.
Series expanding windows have no excluded columns.