I create an ArrayBase
by arr2()
and then create another data by window
and map
, then last I collect the result as vec
as below;
let x = arr2(&[
[1.2, 2.3],
[3.23, 4.3],
[3.2, 443.2],
[32.2, 43.3],
[3.3, 4.5],
[2.3, 3.4],
]);
let y = x
.windows((3, 2))
.into_iter()
.map(|wi| [wi.column(0).sum(), wi.column(1).sum(), *wi.last().unwrap()]).collect::<Vec<_>>();
I want to know whether I can collect the result as ArrayBase
directly, just like which is create by arr2
?