pub fn calculate_median<F>(ts: &Array1<F>) -> Fwhere F: Float + FromPrimitive + Clone,
Calculate median of a time series