numpy iterate over 2d array rows with index code example
Example 1: iterating over 2d array python
x = [ ['0,0', '0,1'], ['1,0', '1,1'], ['2,0', '2,1'] ]
for i in range(len(x)):
for j in range(len(x[i])):
print(x[i][j])
Example 2: iterate over rows in numpy matrix python
import numpy
m = numpy.ones((3,5),dtype='int')
for row in m:
# do stuff with row