This is documentation for an old release of NumPy (version 1.6.0). Read this page in the documentation of the latest stable release (version > 1.17).
Return a copy of the array collapsed into one dimension.
Parameters : | order : {‘C’, ‘F’, ‘A’}, optional
|
---|---|
Returns : | y : ndarray
|
Examples
>>> a = np.array([[1,2], [3,4]])
>>> a.flatten()
array([1, 2, 3, 4])
>>> a.flatten('F')
array([1, 3, 2, 4])