class documentation

class ndenumerate:

View In Hierarchy

Multidimensional index iterator.

Return an iterator yielding pairs of array coordinates and values.

Parameters

arr : ndarray
Input array.

See Also

ndindex, flatiter

Examples

>>> a = np.array([[1, 2], [3, 4]])
>>> for index, x in np.ndenumerate(a):
...     print(index, x)
(0, 0) 1
(0, 1) 2
(1, 0) 3
(1, 1) 4
Method __init__ Undocumented
Method __iter__ Undocumented
Method __next__ Standard iterator method, returns the index tuple and array value.
Instance Variable iter Undocumented
def __init__(self, arr):

Undocumented

def __iter__(self):

Undocumented

def __next__(self):

Standard iterator method, returns the index tuple and array value.

Returns

coords : tuple of ints
The indices of the current iteration.
val : scalar
The array element of the current iteration.
iter =

Undocumented