I have an array of numbers:

```py
y = np.random.rand(1000)

```

What I want to do is to find the maximum value of `y` and then take every n-th element starting from that value's position, both before and after that maximum value occurrence. 

I can not seem to be able to go backwards in the array.

I can easily find the maximum and take every n-th element from there:

```py
idx = np.argmax(y)
newy = y[idx::reprate] # reprate is the number of points I want to skip

```

This, however, excludes all the n-th points before `idx`, which I still want to get.

Is there a straightforward way I am not seeing?