This is documentation for an old release of NumPy (version 1.3.). Read this page in the documentation of the latest stable release (version > 1.17).
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