pub struct GroupByResample<'a> { /* private fields */ }Implementations§
Source§impl GroupByResample<'_>
impl GroupByResample<'_>
Sourcepub fn sum(&self) -> Result<DataFrame, FrameError>
pub fn sum(&self) -> Result<DataFrame, FrameError>
Grouped resample sum.
Sourcepub fn mean(&self) -> Result<DataFrame, FrameError>
pub fn mean(&self) -> Result<DataFrame, FrameError>
Grouped resample mean.
Sourcepub fn count(&self) -> Result<DataFrame, FrameError>
pub fn count(&self) -> Result<DataFrame, FrameError>
Grouped resample count.
Sourcepub fn min(&self) -> Result<DataFrame, FrameError>
pub fn min(&self) -> Result<DataFrame, FrameError>
Grouped resample min.
Sourcepub fn max(&self) -> Result<DataFrame, FrameError>
pub fn max(&self) -> Result<DataFrame, FrameError>
Grouped resample max.
Sourcepub fn first(&self) -> Result<DataFrame, FrameError>
pub fn first(&self) -> Result<DataFrame, FrameError>
Grouped resample first.
Sourcepub fn quantile(&self, q: f64) -> Result<DataFrame, FrameError>
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 interpolationThe 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.
Sourcepub fn median(&self) -> Result<DataFrame, FrameError>
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.
Sourcepub fn var(&self) -> Result<DataFrame, FrameError>
pub fn var(&self) -> Result<DataFrame, FrameError>
Grouped resample variance.
Sourcepub fn std(&self) -> Result<DataFrame, FrameError>
pub fn std(&self) -> Result<DataFrame, FrameError>
Grouped resample standard deviation.
Sourcepub fn sem(&self) -> Result<DataFrame, FrameError>
pub fn sem(&self) -> Result<DataFrame, FrameError>
Grouped resample standard error of the mean.
Sourcepub fn prod(&self) -> Result<DataFrame, FrameError>
pub fn prod(&self) -> Result<DataFrame, FrameError>
Grouped resample product.
Sourcepub fn nunique(&self) -> Result<DataFrame, FrameError>
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.
Sourcepub fn last(&self) -> Result<DataFrame, FrameError>
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> Forget for GroupByResample<'a>
impl<'a> Freeze for GroupByResample<'a>
impl<'a> Move 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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more