Skip to main content

minmax

Function minmax 

Source
pub fn minmax(x: &[f64], y: &[f64], threshold: usize) -> Vec<usize>
Expand description

Min-max decimation: keeps the min and max y-value in each bucket. Faster than LTTB, good for dense time series where peaks matter.

Returns indices into the original arrays. The first and last points are always preserved. Within each bucket, the min and max points are returned in their original order (preserving temporal coherence).

ยงPanics

Panics if x.len() != y.len().