numpy / 1.22.0 / reference / generated / numpy.flatiter.coords.html /

numpy.flatiter.coords

attribute

flatiter. coords

An N-dimensional tuple of current coordinates.

Examples

>>> x = np.arange(6).reshape(2, 3)
>>> fl = x.flat
>>> fl.coords
(0, 0)
>>> next(fl)
0
>>> fl.coords
(0, 1)

© 2005–2021 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/1.22/reference/generated/numpy.flatiter.coords.html