Skip to main content

PandasReductions

Struct PandasReductions 

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

pandas’ float reductions of one numeric column - sum, mean, var, std, sem, skew, kurt - adding in numpy’s exact order, so a long column answers pandas’ bits rather than a nearby value. Measured against live pandas 2.2.3 / numpy 2.3.5; bead br-frankenpandas-9iim6 holds the model and the alternatives it rejected.

Implementations§

Source§

impl<'a> PandasReductions<'a>

Source

pub fn numpy_nan_missing(values: ReductionValues<'a>) -> Self

A numpy float64 array, its NaNs the missing values (nanops’ mask is isnan); read without a presence bitmap.

Source

pub fn new( values: ReductionValues<'a>, present: Option<&'a [u64]>, layout: MissingLayout, ) -> Self

present is the packed presence bits (None: all present).

Source

pub fn count(&self) -> usize

The present values.

Source

pub fn sum(&self) -> f64

Series.sum() of a float column, missing values skipped.

Source

pub fn mean(&self) -> f64

Series.mean(); NaN with no present value.

Source

pub fn int64_mean_skipping(values: &[i64], missing: i64) -> f64

nanops’ mean of int64 values whose slots holding missing (a datetime64 column’s NaT) it fills with 0: the total added as float64 through numpy’s cast buffer, 8192 at a time - as Self::mean adds an int column - read straight off values, over the count of the others. A filled copy and a presence bitmap the sum only re-zeroed made a datetime mean 0.37x pandas (br-frankenpandas-vk7y9). NaN when every slot is missing.

Source

pub fn var(&self, ddof: usize) -> f64

Series.var(ddof=ddof); NaN with ddof or fewer present values.

Source

pub fn std(&self, ddof: usize) -> f64

Series.std(ddof=ddof).

Source

pub fn sem(&self, ddof: usize) -> f64

Series.sem(ddof=ddof): sqrt(var) / sqrt(count).

Source

pub fn skew(&self) -> f64

Series.skew(): pandas’ nanskew; NaN below 3 values, 0 for constant data.

Source

pub fn kurt(&self) -> f64

Series.kurt(): pandas’ nankurt; NaN below 4 values, 0 when the denominator vanishes (constant data).

Trait Implementations§

Source§

impl<'a> Clone for PandasReductions<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for PandasReductions<'a>

Source§

impl<'a> Debug for PandasReductions<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for PandasReductions<'a>

§

impl<'a> RefUnwindSafe for PandasReductions<'a>

§

impl<'a> Send for PandasReductions<'a>

§

impl<'a> Sync for PandasReductions<'a>

§

impl<'a> Unpin for PandasReductions<'a>

§

impl<'a> UnsafeUnpin for PandasReductions<'a>

§

impl<'a> UnwindSafe for PandasReductions<'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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.