numpy.ndarray.flat() in Python

The numpy.ndarray.flat() returns a 1-D iterator over the array. This function is not a subclass of, Python’s built-in iterator object, otherwise it will act the same as a numpy.flatiter instance.

Syntax

Parameter

NA

Return

This function returns a 1-D iteration of an array.

Example 1

Output

Example 2

Output

Pin It on Pinterest

Share This