quantile

Function quantile 

Source
pub fn quantile(data: &mut [f64], p: f64) -> Option<f64>
Expand description

Returns the p-quantile of values in a mutable slice.

The slice will be partially reordered.

ยงExample

use d3rs::array::quantile;

let mut data = vec![3.0, 1.0, 4.0, 1.0, 5.0, 9.0, 2.0, 6.0];
assert_eq!(quantile(&mut data, 0.5), Some(3.5));