Function ndarray::arr2

source ·
pub fn arr2<A: Clone, V>(xs: &[V]) -> Array2<A>where
    V: Clone + FixedInitializer<Elem = A>,
Expand description

Create a two-dimensional array with elements from xs.

use ndarray::arr2;

let a = arr2(&[[1, 2, 3],
               [4, 5, 6]]);
assert!(
    a.shape() == [2, 3]
);