Say I have an arbitrary numpy matrix that looks like this:
arr = [[ 6.0 12.0 1.0] [ 7.0 9.0 1.0] [ 8.0 7.0 1.0] [ 4.0 3.0
arr = np.array( [[ 6.0, 12.0, 1.0], [ 7.0, 9.0, 1.0], [ 8.0, 7.0, 1.0], [ 4.0, 3.0, 2.0], [ 6.0, 1.0, 2.0], [ 2.0, 5.0, 2.0], [ 9.0, 4.0, 3.0], [ 2.0, 1.0, 4.0], [ 8.0, 4.0, 4.0], [ 3.0, 5.0, 4.0]]) np.array([a.mean(0) for a in np.split(arr, np.argwhere(np.diff(arr[:, 2])) + 1)])