Data Science, Data Visualization, Data Analysis, Rust, Programming.
individuals_dist = Binomial::new(0.6, 100).unwrap(); let mut individuals: Vec<f64> = (0 .. 100).map(f64::from).collect(); let y_iter: Vec<f64> = individuals.iter().map(|x| individuals_dist.pmf(*x as u64)).collect(); individuals.into_iter().zip(y_iter).collect() }; In the above code, we set the