numpy.ndarray.__array__#

方法

ndarray.__array__([dtype, ]*, copy=None)#

对于 dtype 参数,如果 dtype 未给出或与数组的数据类型匹配,则返回对自身的全新引用。如果 dtype 与数组的当前数据类型不同,则返回具有提供的数据类型的全新数组。对于 copy 参数,如果 copy=Falsecopy=None 并且 dtype 参数未强制复制,则返回对自身的全新引用。该方法对于 copy=True 返回一个全新数组,无论 dtype 参数如何。

有关 __array__ 接口的更详细解释,请参阅 __array__() 方法