asarray#
- AnsMat.asarray(dtype=None) ndarray #
Return the matrix as a NumPy array.
- Parameters:
- dtype
numpy.dtype
,optional
NumPy data type to upload the array as. The options are
np.double
,np.int32
, andnp.int64
. The default is the current array type.
- dtype
- Returns:
np.ndarray
NumPy array with the defined data type.
Examples
>>> import ansys.math.core.math as pymath >>> mm = pymath.AnsMath() >>> v = mm.ones(2,2) >>> v.asarray() array([[1., 1.], [1., 1.]]) >>> v.asarray(dtype=np.int32) array([[1, 1], [1, 1]])