extendr_api::prelude

Macro stack_new_axis

Source
macro_rules! stack_new_axis {
    ($axis:expr, $( $array:expr ),+ ) => { ... };
}
👎Deprecated since 0.15.0: Use under the name stack instead.
Expand description

Stack arrays along the new axis.

Uses the stack_new_axis() function, calling ArrayView::from(&a) on each argument a.

Panics if the stack function would return an error.

extern crate ndarray;

use ndarray::{arr2, arr3, stack_new_axis, Axis};


let a = arr2(&[[2., 2.],
               [3., 3.]]);
assert!(
    stack_new_axis![Axis(0), a, a]
    == arr3(&[[[2., 2.],
               [3., 3.]],
              [[2., 2.],
               [3., 3.]]])
);