您的位置:首页 > 编程语言 > Python开发

python小问题记录:

2014-05-18 17:03 260 查看

numpy.chararray.flatten

chararray.flatten(order='C')
Return a copy of the array collapsed into one dimension.

Parameters :order : {‘C’, ‘F’, ‘A’}, optional


Whether to flatten in C (row-major), Fortran (column-major) order, or preserve the C/Fortran ordering from a. The default is ‘C’.


Returns :y : ndarray


A copy of the input array, flattened to one dimension.


See also

ravelReturn a flattened array.flatA 1-D flat iterator over the array.
Examples

>>> a = np.array([[1,2], [3,4]])
>>> a.flatten()
array([1, 2, 3, 4])
>>> a.flatten('F')
array([1, 3, 2, 4])
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: