I'm wondering how does ndimage.measurements.center_of_mass
calculate the center of mass values for a two dimensional numpy array.
For example let's say we have an array m:
m = numpy.array([[1,2,3,1],[4,4,4,1],[5,6,7,2]])
Then one would get the following for the coordinates of the center of mass (x, y):
x, y = ndimage.measurements.center_of_mass(m)
x = 1.325 and y = 1.3
So, how are those values of x and y mathematically derived (actual derivation)?
When I follow the steps in the function definition center_of_mass, I don't get that result.