bundles / scipy 1.17.1 / scipy / _lib / array_api_extra / _lib / _utils / _helpers / ndindex
function
scipy._lib.array_api_extra._lib._utils._helpers:ndindex
source: /scipy/_lib/array_api_extra/_lib/_utils/_helpers.py :230
Signature
def ndindex ( * x : int ) → Generator[tuple[int, ...]] Summary
Generate all N-dimensional indices for a given array shape.
Extended Summary
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.
This has an identical API to numpy.ndindex.
Parameters
*x: intThe shape of the array.
Aliases
-
scipy.differentiate.xpx._delegation._funcs.ndindex