import numpy as np
a=np.array([1,2,3,4])
b=np.array([[1,2,3,4],[5,6,7,8],[9,10,11,12]])
for i,j in enumerate(a):
print("i",i,"j",j)
# i 0 j 1
# i 1 j 2
# i 2 j 3
# i 3 j 4
import numpy as np
for i,j in enumerate(b):
print("i",i,"j",j)
# i 0 j 1
# i 1 j 2
# i 2 j 3
# i 3 j 4
# i 0 j [1 2 3 4]
# i 1 j [5 6 7 8]
# i 2 j [ 9 10 11 12]
for i,(xs,ys) in enumerate(zip(a,b)):
print("i",i,"(xs,ys)",xs,ys)
# i 0 (xs,ys) 1 [1 2 3 4]
# i 1 (xs,ys) 2 [5 6 7 8]
# i 2 (xs,ys) 3 [ 9 10 11 12]