pub fn hstack<T>(arrays: &[ArrayView2<'_, T>]) -> CoreResult<Array2<T>>Expand description
Stack a sequence of 2D arrays horizontally (concatenate columns).
All arrays must have the same number of rows. Returns an error if the slice is empty or if any row-count mismatches exist.
ยงExamples
use scirs2_core::ops::hstack;
use ndarray::array;
let a = array![[1.0_f64, 2.0], [3.0, 4.0]];
let b = array![[5.0_f64], [6.0]];
let s = hstack(&[a.view(), b.view()]).expect("same row count");
assert_eq!(s.shape(), &[2, 3]);
assert_eq!(s[[0, 2]], 5.0);
assert_eq!(s[[1, 2]], 6.0);