matrix.flatten(order='C')[source]¶Return a flattened copy of the matrix.
AllN elements of the matrix are placed into a single row.
| Parameters: | order : {‘C’, ‘F’, ‘A’, ‘K’}, optional
|
|---|---|
| Returns: | y : matrix
|
Examples
>>>m=np.matrix([[1,2],[3,4]])>>>m.flatten()matrix([[1, 2, 3, 4]])>>>m.flatten('F')matrix([[1, 3, 2, 4]])