for loop np array code example
Example 1: iterate through an array python
colors = ["red", "green", "blue", "purple"]
i = 0
while i < len(colors):
print(colors[i])
i += 1
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