Skip to main content

GroupByResample

Struct GroupByResample 

Source
pub struct GroupByResample<'a> { /* private fields */ }

Implementations§

Source§

impl GroupByResample<'_>

Source

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

Grouped resample sum.

Source

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

Grouped resample mean.

Source

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

Grouped resample count.

Source

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

Grouped resample min.

Source

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

Grouped resample max.

Source

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

Grouped resample first.

Source

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

Grouped resample quantile.

br-frankenpandas-a7faz, the last reduction-shaped aggregation Resample implements that the grouped wrapper did not expose. Takes q rather than defaulting it, matching pd.Resampler.quantile(q).

MEASURED, live pandas 2.2.3 (CrimsonPine 2026-08-18), grp=[a,a,a,b,b,b], v=[1,3,5,2,4,8], buckets a-Jan(1,3) a-Feb(5) b-Jan(2) b-Feb(4,8):

  quantile(0.5)  -> [2.0, 5.0, 2.0, 6.0]     equals median, as it should
  quantile(0.25) -> [1.5, 5.0, 2.0, 5.0]     LINEAR interpolation

The 0.25 row is the load-bearing one: 1 + 0.25*(3-1) = 1.5 and 4 + 0.25*(8-4) = 5.0, so an implementation picking a nearest or lower order-statistic instead of interpolating would give 1.0 and 4.0 and still pass every 0.5 assertion.

⚠️ NOT wired to agg("quantile"): that string form carries no q and is pandas’ default 0.5, which the pivot surface already established is the same as median. This method is the one that can express any other q.

Source

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

Grouped resample median.

br-frankenpandas-a7faz. Resample has implemented median/var/prod/std/sem/ nunique all along; GroupByResample exposed only seven aggregations, so df.groupby(k).resample(f).median() could not be expressed at all. These six wrappers close that gap; each declares the dtype domain its pandas counterpart accepts.

MEASURED, live pandas 2.2.3 (CrimsonPine 2026-08-18), grp=[a,a,a,b,b,b], v=[1,3,5,2,4,8], buckets a-Jan(1,3) a-Feb(5) b-Jan(2) b-Feb(4,8):

  median  [2.0, 5.0, 2.0, 6.0]
  var     [2.0, NaN, NaN, 8.0]      single-element buckets are NaN
  prod    [3.0, 5.0, 2.0, 32.0]
  nunique [2, 1, 1, 2]

std and sem RAISE on this frame in pandas — not because the aggregation is undefined but because it tries to convert the utf8 GROUP KEY to float. They are still added here: FrankenPandas excludes the key from value_cols by construction, so the numeric columns aggregate cleanly and the raise has no FrankenPandas counterpart to reproduce.

Source

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

Grouped resample variance.

Source

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

Grouped resample standard deviation.

Source

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

Grouped resample standard error of the mean.

Source

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

Grouped resample product.

Source

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

Grouped resample distinct-value count.

The one of the six that is NOT numeric-only: pandas counts distinct values for utf8, bool, datetime64 and category alike, which is the same domain count/min/max/first/last already take.

Source

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

Grouped resample last.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for GroupByResample<'a>

§

impl<'a> !UnwindSafe for GroupByResample<'a>

§

impl<'a> Freeze for GroupByResample<'a>

§

impl<'a> Send for GroupByResample<'a>

§

impl<'a> Sync for GroupByResample<'a>

§

impl<'a> Unpin for GroupByResample<'a>

§

impl<'a> UnsafeUnpin for GroupByResample<'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 = !

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

fn try_from(value: U) -> Result<T, !>

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.