This is documentation for an old release of NumPy (version 1.3.). Read this page in the documentation of the latest stable release (version > 1.17).
Collapse an array into one dimension.
Parameters: | order : {‘C’, ‘F’}, 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])