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

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

The alternative for iterators returning non-references is mean_and_variance_par_iter_val

Examples

see the example of mean_par_iter and variance_par_iter.