Skip to main content

DataFrameRolling

Struct DataFrameRolling 

Source
pub struct DataFrameRolling<'a> { /* private fields */ }
Expand description

Rolling window aggregation over a DataFrame’s numeric columns.

Created by DataFrame::rolling(). Applies the rolling window to each numeric column independently.

Implementations§

Source§

impl DataFrameRolling<'_>

Source

pub fn sum(&self) -> Result<DataFrame, FrameError>

Rolling sum across all numeric columns.

Source

pub fn mean(&self) -> Result<DataFrame, FrameError>

Rolling mean across all numeric columns.

Source

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

Rolling min across all numeric columns.

Source

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

Rolling max across all numeric columns.

Source

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

Rolling standard deviation across all numeric columns.

Source

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

Rolling count of non-null values across all numeric columns.

Source

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

Rolling variance across all numeric columns.

Source

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

Rolling median across all numeric columns.

Source

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

Rolling skewness across all numeric columns.

Matches df.rolling(window).skew(). Closes parity gap — the Series-level Rolling has skew()/kurt()/first()/last()/prod() but DataFrameRolling was missing all of them.

Source

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

Rolling excess kurtosis across all numeric columns.

Matches df.rolling(window).kurt().

Source

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

Alias for kurt() — pandas exposes both spellings.

Source

pub fn first(&self) -> Result<DataFrame, FrameError>

Rolling first non-null value across all numeric columns.

Matches df.rolling(window).first().

Source

pub fn last(&self) -> Result<DataFrame, FrameError>

Rolling last non-null value across all numeric columns.

Matches df.rolling(window).last().

Source

pub fn prod(&self) -> Result<DataFrame, FrameError>

Rolling product across all numeric columns.

Matches df.rolling(window).prod().

Source

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

Rolling quantile across all numeric columns.

Source

pub fn corr(&self) -> Result<DataFrame, FrameError>

Rolling pairwise Pearson correlation across numeric columns.

Produces one output column per upper-triangular pair: {left}__{right}.

Source

pub fn cov(&self) -> Result<DataFrame, FrameError>

Rolling pairwise sample covariance (ddof=1) across numeric columns.

Produces one output column per upper-triangular pair: {left}__{right}.

Source

pub fn corr_with(&self, other: &Series) -> Result<DataFrame, FrameError>

Rolling correlation of each numeric column with other.

Matches pd.DataFrame.rolling(window).corr(other) when other is a Series: produces a DataFrame with one column per numeric input, each containing the rolling Pearson correlation between that column and other. Column names are preserved.

Source

pub fn cov_with(&self, other: &Series) -> Result<DataFrame, FrameError>

Rolling covariance of each numeric column with other.

Matches pd.DataFrame.rolling(window).cov(other) when other is a Series: produces a DataFrame with one column per numeric input containing the rolling sample covariance (ddof=1) with other. Column names are preserved.

Source

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

Aggregate each numeric column with multiple rolling functions.

Matches df.rolling(window).agg(['sum', 'mean']). Output columns are named {column}_{function}.

Source

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

pandas alias for Self::agg.

Source

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

Rolling standard error of the mean across numeric columns.

Source

pub fn rank( &self, method: &str, ascending: bool, na_option: &str, ) -> Result<DataFrame, FrameError>

Rolling rank across numeric columns.

Source

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

Frozenset-style label set excluded from this rolling window.

DataFrame rolling currently processes all numeric columns and excludes no labels.

Source

pub fn ndim(&self) -> usize

Number of dimensions of the underlying object. DataFrame rolling is 2D.

Auto Trait Implementations§

§

impl<'a> Freeze for DataFrameRolling<'a>

§

impl<'a> RefUnwindSafe for DataFrameRolling<'a>

§

impl<'a> Send for DataFrameRolling<'a>

§

impl<'a> Sync for DataFrameRolling<'a>

§

impl<'a> Unpin for DataFrameRolling<'a>

§

impl<'a> UnsafeUnpin for DataFrameRolling<'a>

§

impl<'a> UnwindSafe for DataFrameRolling<'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.