mean

Function mean 

Source
pub fn mean(data: &[f64]) -> Option<f64>
Expand description

Returns the arithmetic mean of values in the slice.

Returns None if the slice is empty.

ยงExample

use d3rs::array::mean;

let data = vec![1.0, 2.0, 3.0, 4.0, 5.0];
assert_eq!(mean(&data), Some(3.0));