The definition of asarray
is:
def asarray(a, dtype=None, order=None):
return array(a, dtype, copy=False, order=order)
So it is like array
, except it has fewer options, and copy=False
. array
has copy=True
by default.
The main difference is that array
(by default) will make a copy of the object, while asarray
will not unless necessary.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…