def mpd(distmat):
 return (distmat.sum() / (distmat.size - distmat.shape[0]))

def mpd ( distmat ) : return ( distmat . sum ( ) / ( distmat . size - distmat . shape [ 0 ] ) )
return mean of pairwise dists .