pub fn mean_and_variance_par_iter_val<It, T>(data: It) -> [T; 2]where
    T: Clone + Div<f64, Output = T> + Sum<T> + Sum<It::Item> + Send + Sub<T, Output = T> + Mul<T, Output = T> + Zero,
    It: IndexedParallelIterator<Item = T> + Clone,
Expand description

Compute the mean and variance (squared of standard deviation) from a [rayon::iter::IndexedParallelIterator] by value. Provides better performance than computing the mean and variation separately as this method consume the iterator only once.

The alternative for iterators returning references is mean_and_variance_par_iter.

Example

see the example of mean_par_iter_val and variance_par_iter_val.