Run »
import numpy as np arr = np.array([1, 2, 3]) for idx, x in np.ndenumerate(arr): print(idx, x)
(0,) 1 (1,) 2 (2,) 3