Hi @zetyquickly
Thanks for pointing that out, yes you are correct, it should be mean on cumsum, I corrected the post regarding that.
Yes, doing the loop over the index will gives the results.
I wonder if there is a non-loop version that I am not aware of it because loops can be slow for large length.
I am not sure if I got the mean(axis=3) suggestion. can you please elaborate on that?
Thanks for your help!