I have a numpy.ndarray that has values -1 or 1. The array is quite long, but I will post a little sample.
array([ 1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, -1,
1, 1, 1], dtype=int8)
The array continues till about index 200. I would like to find the location where there are N consecutive values equal to either 1 or -1. So in the example above it should return index 11, 12, 13 if N was equal to 8.