Question: I want to extract very specific elements from an array to create various ranges.

For example,

```
ranges = np.arange(0, 525, 25)
#array([  0,  25,  50,  75, 100, 125, 150, 175, 200, 225, 250, 275, 300, 325, 350, 375, 400, 425, 450, 475, 500])

```

I want to create ranges that output as this-

```
0 50
75 125
150 200
225 275
300 350
375 425
450 500

```

I know if I want to extract every number into a range, I can write something like this-

```
for start, end in zip(ranges[:-1], ranges[1:]):
    print(start, end)

```

Which would give the result-

```
0 50
25 75
50 100
75 125
100 150
125 175
150 200
175 225
200 250
225 275
250 300
275 325
300 350
325 375
350 400
375 425
400 450
425 475

```

However, I'm not sure how to extract every other element from the array.

Answer: 
You can create your two ranges, then `stack` them on the column axis:

```
np.stack((np.arange(0, 500, 75), np.arange(50, 550, 75)), axis=1)

```

Generalized:

```
>>> start = 50
>>> step = 75
>>> end = 550
>>> np.stack((np.arange(0, end - start, step), np.arange(start, end, step)), axis=1)
array([[  0,  50],
       [ 75, 125],
       [150, 200],
       [225, 275],
       [300, 350],
       [375, 425],
       [450, 500]])

```
```
lowestMidPoint, highestMidPoint = 25, 475
ranges = [[midpoint-25, midpoint+25] for midpoint in range(lowestMidPoint,highestMidPoint+1,75)]

```

will get you the results as an array of arrays. You can then just call `np.array(ranges)` to get it in numpy.

To answer your question "how do i get every other entry in the array?"... if you have a numpy array

```
out = 
  1 2
  3 4
  5 6

```

you can slice `out` as follows

```
stride = 2
out[::stride,:]

```

to get every other row