Skip to main content

Expanding

Struct Expanding 

Source
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<'_>

Source

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).

Source

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).

Source

pub fn min(&self) -> Result<Series, FrameError>

Expanding minimum.

Source

pub fn max(&self) -> Result<Series, FrameError>

Expanding maximum.

Source

pub fn std(&self) -> Result<Series, FrameError>

Expanding sample standard deviation (ddof=1).

Source

pub fn var(&self) -> Result<Series, FrameError>

Expanding sample variance (ddof=1).

Source

pub fn median(&self) -> Result<Series, FrameError>

Expanding median.

Source

pub fn apply<F>(&self, func: F) -> Result<Series, FrameError>
where F: Fn(&[f64]) -> f64,

Apply a custom function over the expanding window.

Matches series.expanding().apply(func).

Source

pub fn count(&self) -> Result<Series, FrameError>

Expanding count of non-null values.

Matches series.expanding().count().

Source

pub fn quantile(&self, q: f64) -> Result<Series, FrameError>

Expanding quantile.

Matches series.expanding().quantile(q).

Source

pub fn skew(&self) -> Result<Series, FrameError>

Expanding skewness (bias=False, Fisher’s definition).

Matches pd.Series.expanding().skew().

Source

pub fn kurt(&self) -> Result<Series, FrameError>

Expanding excess kurtosis (Fisher’s definition, bias=False).

Matches pd.Series.expanding().kurt().

Source

pub fn kurtosis(&self) -> Result<Series, FrameError>

Alias for kurt() — pandas exposes both spellings on Series.expanding aggregations.

Source

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.

Source

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.

Source

pub fn sem(&self) -> Result<Series, FrameError>

Expanding standard error of the mean.

Matches series.expanding().sem().

Source

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().

Source

pub fn agg(&self, funcs: &[&str]) -> Result<DataFrame, FrameError>

Aggregate with multiple functions, returning a DataFrame.

Matches series.expanding().agg(['sum', 'mean']).

Source

pub fn aggregate(&self, funcs: &[&str]) -> Result<DataFrame, FrameError>

pandas alias for Self::agg.

Matches series.expanding().aggregate([...]).

Source

pub fn exclusions(&self) -> Vec<String>

Frozenset-style label set excluded from this expanding window.

Series expanding windows have no excluded columns.

Source

pub fn ndim(&self) -> usize

Number of dimensions of the underlying object. Series expanding is 1D.

Auto Trait Implementations§

§

impl<'a> Freeze for Expanding<'a>

§

impl<'a> RefUnwindSafe for Expanding<'a>

§

impl<'a> Send for Expanding<'a>

§

impl<'a> Sync for Expanding<'a>

§

impl<'a> Unpin for Expanding<'a>

§

impl<'a> UnsafeUnpin for Expanding<'a>

§

impl<'a> UnwindSafe for Expanding<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.