numpy.ndarray.flatten() in Python

The numpy.ndarray.flatten() returns a copy of the array collapsed into 1-dimension.

Syntax

Parameter

The numpy. ndarray.flatten() method consists of one parameter, which is as follows:

order : This parameter can be either C_contiguous or F_contiguous where C order operates row-rise on the array, and  F order operates column-wise operations.

Return

This function returns a copy of the input array, flattened to one dimension.

Example 1

Output

Pin It on Pinterest

Share This