numpy.ndindex()

numpy.ndindex

class numpy.ndindex(*shape) [source]

An N-dimensional iterator object to index arrays.

Given the shape of an array, an ndindex instance iterates over the N-dimensional index of the array. At each iteration a tuple of indices is returned, the last dimension is iterated over first.

Parameters:

`*args` : ints

The size of each dimension of the array.