I have an array. I want to create a new array which is the average over every third element. So the new array will be a third of the size as the original.
As an example:
[1,2,3,1,2,3,1,2,3]
should return the array:
[2,2,2]
Can anyone suggest an efficient way of doing this? I want to do this without using numpy.