I do not understand your code completely, is the reference to numpy really relevant for your question? What is M
?
If you have two lists of the same lengths you can get pairs of elements using the zip
builtin.
A = [1, 2, 3]
B = ['a', 'b', 'c']
for a, b in zip(A, B):
print(a)
print(b)
This will print
1
a
2
b
3
c