numpy.ndarray.__array__#

method

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

对于 dtype 参数,如果没有给定 dtype 或者它与数组的数据类型匹配,则返回对 self 的新引用.如果 dtype 与数组的当前数据类型不同,则返回所提供数据类型的新数组.对于 copy 参数,如果 copy=Falsecopy=Nonedtype 参数未强制复制,则返回对 self 的新引用.对于 copy=True ,该方法将返回一个新数组,而不管 dtype 参数如何.

有关 __array__ 接口的更详细说明,请参见 __array__() 方法 .