Function nalgebra_numpy::matrix_from_numpy[][src]

pub fn matrix_from_numpy<N, R, C>(
    py: Python<'_>,
    input: &PyAny
) -> Result<MatrixMN<N, R, C>, Error> where
    N: Scalar + Element,
    R: Dim,
    C: Dim,
    DefaultAllocator: Allocator<N, R, C>, 

Create an owning nalgebra matrix from a numpy array.

The data is copied into the matrix.

The array dtype must match the output type exactly. If desired, you can convert the array to the desired type in Python using numpy.ndarray.astype.