asarray#
- AnsVec.asarray(dtype=None) ndarray #
Return the vector as a NumPy array.
- Parameters:
- dtype
numpy.dtype
,optional
NumPy data type to upload the array as. The options are
numpy.double
,numpy.int32
, andnumpy.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(10) >>> v.asarray() [1. 1. 1. 1. 1. 1. 1. 1. 1. 1.] >>> v.asarray(dtype=np.int32) [1 1 1 1 1 1 1 1 1 1]