numpy.ndenumerate
- class numpy.ndenumerate(arr)[source]
-
Многомерный итератор индексов.
Возвращает итератор, генерирующий пары координат массива и значений.
- Параметры
-
- arrndarray
-
Входной массив.
Примеры
>>> 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
© 2005–2022 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/1.21/reference/generated/numpy.ndenumerate.html