I want to make especific pairs in a numpy array and I show what I want with a simple print function. I have two arrays:
points=np.arange(1,15)
Then I have another array:
repetition= np.array([4, 4, 2, 2, 1, 1])
Now, I want to print the following pairs (I just wrote the comment to show what I want):
1 5 # first value of points and (1+4)th value of point
2 6 # second value of points and (2+4)th value of point
3 7 # third value of points and (3+4)th value of point
4 8 # fourth value of points and (3+4)th value of point
7 9 # seventh value of points and (6+2)th value of point
8 10 # eighth value of points and (8+2)th value of point
9 11 # ninth value of points and (9+2)th value of point
10 12 # tenth value of points and (10+2)th value of point
12 13 # twelfth value of points and (11+2)th value of point
13 14 # thirteenth value of points and (13+1)th value of point
I tried the following code but it did not give me the result I expect:
for m, n in zip (points, repetition):
print (m, m+n)
In the fig, I visualized my question in which red lines are showing my pairs. I do appreciate any help in advance.