In Numpy, there is a package numpy.nditer to iterate each element of Numpy array. It is a multi-dimensional iterator. Basically, It can be used from basic to advanced iterations. It also solves some basic issues.
import numpy as np array_0 = np.array([[['a','b','c'], ['d','e','f']],[[1,2,3],[4,5,6]]]) for x in np.nditer(array_0): print(x)
a b c d e f 1 2 3 4 5 6