Convert the input to an array.
Parameters: | a : array_like
dtype : data-type, optional
order : {‘C’, ‘F’}, optional
|
---|---|
Returns: | out : ndarray
|
See also
Examples
Convert a list into an array:
>>> a = [1, 2]
>>> np.asarray(a)
array([1, 2])
Existing arrays are not copied:
>>> a = np.array([1, 2])
>>> np.asarray(a) is a
True