I get the error 'ndarray: could not broadcast array from shape: [1] to: ' from this function:
fn make_products_six(vec: &[usize]) -> Array2<usize> {
println!("5555 = {:?}", 5555);
let this = vec.iter().map(|x| if *x == 666 {1_usize} else {*x}).collect::<Vec<_>>();
let mut results = Array2::<usize>::zeros((this[0]*this[1]*this[2]*this[3]*this[4]*this[5],6));
let mut count: usize = 0;
for index in 0..vec.len() {
println!("(index) = {:?}", (index));
while count < results.shape()[0] {
if vec[index] != 666 {
for i in 0..vec[index] {
results.slice_mut(s![count,index]).assign(&array![i]);
count += 1;
}
}
if vec[index] == 666 {
for i in vec![vec[index]].iter() {
results.slice_mut(s![count,index]).assign(&array![*i]);
count += 1;
}
}
println!("(count,index) = {:?}", (count,index));
}
}
println!("make_products_six results = {:?}",results);
results
}