If I have a numpy array like this (8 two dimensional sub arrays):
array([[[1, 1, 1],
[1, 1, 1]],
[[2, 2, 2],
[2, 2, 2]],
[[1, 1, 1],
[1, 1, 1]],
[[2, 2, 2],
[2, 2, 2]],
[[3, 3, 3],
[3, 3, 3]],
[[4, 4, 4],
[4, 4, 4]],
[[3, 3, 3],
[3, 3, 3]],
[[4, 4, 4],
[4, 4, 4]]])
How do I average every four two dimensional arrays such that I get a new array that looks like this:
array([[[1.5, 1.5, 1.5],
[1.5, 1.5, 1.5]],
[[3.5, 3.5, 3.5],
[3.5, 3.5, 3.5]]])