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§
Sourcefn n_vsum_filter<U, I>(self, mask: I) -> (usize, T::Inner)
fn n_vsum_filter<U, I>(self, mask: I) -> (usize, T::Inner)
Sourcefn n_sum_filter<U, I>(self, mask: I) -> Option<T::Inner>
fn n_sum_filter<U, I>(self, mask: I) -> Option<T::Inner>
Sourcefn vmean_filter<U, I>(self, mask: I, min_periods: usize) -> f64
fn vmean_filter<U, I>(self, mask: I, min_periods: usize) -> f64
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.
Sourcefn vpercentile_of(self, score: T, method: PercentileOfMethod) -> f64
fn vpercentile_of(self, score: T, method: PercentileOfMethod) -> f64
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:PercentileOfMethod::Rank: Average percentage ranking of the score. In case of multiple matches, averages the percentage rankings of all matching scores.PercentileOfMethod::Weak: Corresponds to the definition of a cumulative distribution function (CDF), including the score itself.PercentileOfMethod::Strict: Similar toPercentileOfMethod::Weak, but only counts values strictly less than the score.
§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", so this trait is not object safe.