NumPy参考 >例行程序 >Indexing routines >numpy.flatiter > numpy.flatiter.copy
方法
flatiter.
copy
获取迭代器的副本作为一维数组。
例子
>>> x = np.arange(6).reshape(2, 3) >>> x array([[0, 1, 2], [3, 4, 5]]) >>> fl = x.flat >>> fl.copy() array([0, 1, 2, 3, 4, 5])