median

Function median 

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

Get the median of a set of data

This takes linear time and linear space.

ยงExamples

let med = inc_stats::median(&[3.0, 1.0, 2.0]).unwrap();
assert_eq!(2.0, med);
let med = inc_stats::median(std::iter::empty::<f64>());
assert!(med.is_none());