let mean_no_nan array = let sum, nb = Array.fold_left (fun ((sum, nb) as accu) x -> if classify_float x = FP_nan then accu else sum +. x, succ nb) (0.,0) array in sum /. float nb