# Last edited on 2025-08-29 08:50:49 by stolfi def barycenter(P): # Expects {P} to be a {numpy} matrix. Computes the # average of all rows. savg = numpy.sum(P, 0) debug("shape(savg)", numpy.shape(savg)) savg = savg/numpy.size(P, 0) return savg # ----------------------------------------------------------------------