Skip to main content

DataFrameResample

Struct DataFrameResample 

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

Time-based resampling view over a DataFrame’s numeric columns.

Created by DataFrame::resample(freq). Groups by time buckets and aggregates.

Implementations§

Source§

impl DataFrameResample<'_>

Source

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

Resample sum across all numeric columns.

Source

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

Resample mean across all numeric columns.

Source

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

Resample count across all numeric columns.

Source

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

Resample min across all numeric columns.

Source

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

Resample max across all numeric columns.

Source

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

Resample product across all numeric columns.

Source

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

Resample first across all numeric columns.

Matches df.resample(freq).first(). README line 494 lists first in the Resample row; fd90.200 brings the DataFrameResample direct- method surface up to parity with Series Resample.

Source

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

Resample last across all numeric columns.

Matches df.resample(freq).last(). fd90.200 sibling of first.

Source

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

Resample standard deviation (ddof=1) across all numeric columns.

Matches df.resample(freq).std(). Closes parity gap — pandas exposes std/var/median/skew/kurt on DataFrame.resample(); the fp-frame impl only had sum/mean/min/max/first/last/sem before.

Source

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

Resample variance (ddof=1) across all numeric columns.

Matches df.resample(freq).var().

Source

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

Resample median across all numeric columns.

Matches df.resample(freq).median().

Source

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

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

Matches df.resample(freq).skew().

Source

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

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

Matches df.resample(freq).kurt().

Source

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

Alias for kurt() — pandas exposes both spellings.

Source

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

Aggregate with multiple functions, producing prefixed column names.

Matches df.resample(freq).agg(['sum', 'mean']). Each numeric column gets one output column per function, named {col}_{func}.

Source

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

pandas spelling alias for Self::agg.

Source

pub fn keys(&self) -> Vec<IndexLabel>

Bucket labels in first-observed order.

Source

pub fn indices(&self) -> HashMap<IndexLabel, Vec<usize>>

Mapping from bucket labels to source row positions.

Source

pub fn groups(&self) -> HashMap<IndexLabel, Vec<usize>>

Alias for Self::indices.

Source

pub fn grouper(&self) -> String

Resample frequency descriptor used as the grouper.

Source

pub fn level(&self) -> String

Resample grouping level descriptor.

Source

pub fn ngroups(&self) -> usize

Number of non-empty resample buckets.

Source

pub fn ndim(&self) -> usize

DataFrame resampler dimensionality.

Source

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

Labels excluded from the resample operation.

Source

pub fn get_group(&self, name: &str) -> Result<DataFrame, FrameError>

Return all source rows for one resample bucket.

Source

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

Resample to bucket frequency without reduction.

Source

pub fn ffill(&self, limit: Option<usize>) -> Result<DataFrame, FrameError>

Forward-fill each resample bucket.

Source

pub fn bfill(&self, limit: Option<usize>) -> Result<DataFrame, FrameError>

Backward-fill each resample bucket.

Source

pub fn fillna(&self, value: &Scalar) -> Result<DataFrame, FrameError>

Fill missing values after bucket materialization.

Source

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

Interpolate missing values after bucket materialization.

Source

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

Select nearest observed value for each current non-empty bucket.

Source

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

Resample quantile across numeric columns.

Source

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

Resample standard error of the mean across numeric columns.

Source

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

Count source rows in each resample bucket.

Source

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

Count unique non-missing values per bucket for every column.

Source

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

Open-high-low-close per bucket for each numeric column.

Source

pub fn transform(&self, func: &str) -> Result<DataFrame, FrameError>

Broadcast a named bucket reduction back to the original DataFrame shape.

Source

pub fn pipe<T, F>(&self, func: F) -> Result<T, FrameError>
where F: Fn(&Self) -> Result<T, FrameError>,

Pipe this resampler through a caller-provided function.

Auto Trait Implementations§

§

impl<'a> Freeze for DataFrameResample<'a>

§

impl<'a> RefUnwindSafe for DataFrameResample<'a>

§

impl<'a> Send for DataFrameResample<'a>

§

impl<'a> Sync for DataFrameResample<'a>

§

impl<'a> Unpin for DataFrameResample<'a>

§

impl<'a> UnsafeUnpin for DataFrameResample<'a>

§

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