Function inc_stats::mode[][src]

pub fn mode<T, V, I>(data: I) -> Option<T> where
    T: Float + ToBytes,
    V: DerefCopy<Output = T>,
    I: IntoIterator<Item = V>, 
Expand description

Get the mode of a set of data

If multiple modes exist, this returns the first element that reached the largest count. NaNs are ignored when computing the mode.

Examples:

let mode = inc_stats::mode(&[2.0, 4.0, 2.0]);
assert_eq!(Some(2.0), mode);
let mode: Option<f64> = inc_stats::mode(&[]);
assert!(mode.is_none());