use ndarray::{Array2, Zip, Axis}; use ndarray::prelude::*; fn main() { let a: Array2 = Array2::zeros((5,5)); let mut d: Array1 = array![1.0,2.0,3.0,4.0,5.0]; for i in 0 .. 5 { Zip::from(a.index_axis(Axis(0), i)) .and(&mut d) .for_each(|x, y| *y = *y + x + 10.0); } println!("{:?}", d); }