Skip to main content

AggValidExt

Trait AggValidExt 

Source
pub trait AggValidExt<T: IsNone>: IntoIterator<Item = T> + Sized {
    // Provided methods
    fn n_vsum_filter<U, I>(self, mask: I) -> (usize, T::Inner)
       where I: IntoIterator<Item = U>,
             U: IsNone,
             U::Inner: Cast<bool>,
             T::Inner: Number { ... }
    fn n_sum_filter<U, I>(self, mask: I) -> Option<T::Inner>
       where I: IntoIterator<Item = U>,
             U: IsNone,
             U::Inner: Cast<bool>,
             T::Inner: Number { ... }
    fn vmean_filter<U, I>(self, mask: I, min_periods: usize) -> f64
       where I: IntoIterator<Item = U>,
             U: IsNone,
             U::Inner: Cast<bool>,
             T::Inner: Number { ... }
    fn vkurt(self, min_periods: usize) -> f64
       where T::Inner: Number { ... }
    fn vpercentile_of(self, score: T, method: PercentileOfMethod) -> f64
       where T::Inner: Number + PartialOrd,
             T: IsNone { ... }
}
Expand description

Extension trait providing additional aggregation methods for iterables with potentially invalid (None) values.

Provided Methods§

Source

fn n_vsum_filter<U, I>(self, mask: I) -> (usize, T::Inner)
where I: IntoIterator<Item = U>, U: IsNone, U::Inner: Cast<bool>, T::Inner: Number,

Computes the sum of valid values filtered by a mask, along with the count of valid elements.

§Arguments
  • mask - An iterable of boolean-like values used to filter the input.
§Returns

A tuple containing the count of valid elements and their sum.

Source

fn n_sum_filter<U, I>(self, mask: I) -> Option<T::Inner>
where I: IntoIterator<Item = U>, U: IsNone, U::Inner: Cast<bool>, T::Inner: Number,

Computes the sum of valid values filtered by a mask.

§Arguments
  • mask - An iterable of boolean-like values used to filter the input.
§Returns

The sum of valid elements, or None if no valid elements are found.

Source

fn vmean_filter<U, I>(self, mask: I, min_periods: usize) -> f64
where I: IntoIterator<Item = U>, U: IsNone, U::Inner: Cast<bool>, T::Inner: Number,

Computes the mean of valid values filtered by a mask.

§Arguments
  • mask - An iterable of boolean-like values used to filter the input.
  • min_periods - The minimum number of valid elements required to compute the mean.
§Returns

The mean of valid elements, or NaN if the number of valid elements is less than min_periods.

Source

fn vkurt(self, min_periods: usize) -> f64
where T::Inner: Number,

Computes the kurtosis of the data.

§Arguments
  • min_periods - The minimum number of valid elements required to compute the kurtosis.
§Returns

The kurtosis of the data, or NaN if the number of valid elements is less than min_periods.

Source

fn vpercentile_of(self, score: T, method: PercentileOfMethod) -> f64
where T::Inner: Number + PartialOrd, T: IsNone,

Computes the percentile rank of a given score relative to a list of scores.

§Arguments
  • score - The score for which the percentile rank is computed.
  • method - The method used for the percentile calculation:
§Returns

The percentile rank of the given score as a f64. Returns NaN if the score is None.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<I: IntoIterator<Item = T>, T: IsNone> AggValidExt<T> for I