Skip to main content

array

Function array 

Source
pub fn array<T, D>(dim: D, data: Vec<T>) -> Result<Array<T, D>, FerrayError>
where T: Element, D: Dimension,
Expand description

Create an array from a flat vector and a shape (C-order).

This is the primary “array constructor” — analogous to numpy.array() when given a flat sequence plus a shape.

§Errors

Returns FerrayError::ShapeMismatch if data.len() does not equal the product of the shape dimensions.