let's say I have some numpy array (in this case it represents a 100x100 binary image)...
img=np.random.randint(0,2,(100,100)).astype(numpy.uint8)
How best to determine the "average position" of the 1 values in the array? For instance, if therer was a cluster of 1's in the array, I would like to find the center of that cluster.