Averaging all the rows in a matrix
I would like to take a 2D matrix and get a vector out. Each element in the vector would be the average value of the corresponding column in the matrix. For a small example:
0 1 1
2 3 4
5 2 1
Would lead to:
7/3 2 2
It is relatively easy to do with jit.convolve and a kernel big enough to grab every value in a column, but that seems terribly inefficient. Is there a better way to do this?
way back when, I wrote an object for exactly this purpose called xray.jit.mean:
wes
Thank you, that is just what I needed!