I would like to extract groups of every N continuous elements from an array. For a numpy array like this:
a = numpy.array([1,2,3,4,5,6,7,8])I wish to have (N=5):
array([[1,2,3,4,5], [2,3,4,5,6], [3,4,5,6,7], [4,5,6,7,8]])so that I can run further functions such as average and sum. How do I produce such an array?