def random_mntd(distmat, n, iters):
 means = []
 indices = arange(distmat.shape[0])
 for i in range(iters):
  shuffle(indices)
  means.append(mntd(reduce_mtx(distmat, indices[:n])))
 return (mean(means), std(means))

def random_mntd ( distmat , n , iters ) : means = [ ] indices = arange ( distmat . shape [ 0 ] ) for i in range ( iters ) : shuffle ( indices ) means . append ( mntd ( reduce_mtx ( distmat , indices [ : n ] ) ) ) return ( mean ( means ) , std ( means ) )
calc mean .