def load_paperdata(distance_f):
	logger.info("PROGRESS: load data")
	distances = {}
	min_dis, max_dis = sys.float_info.max, 0.0
	max_id = 0
	with open(distance_f, 'r') as fp:
		for line in fp:
			x1, x2, d = line.strip().split(' ')
			x1, x2 = int(x1), int(x2)
			max_id = max(max_id, x1, x2)
			dis = float(d)
			min_dis, max_dis = min(min_dis, dis), max(max_dis, dis)
			distances[(x1, x2)] = float(d)
			distances[(x2, x1)] = float(d)
	for i in xrange(max_id):
		distances[(i, i)] = 0.0
	logger.info("PROGRESS: load end")
	return distances, max_dis, min_dis, max_id
Accumulate some connections
dataset/ETHPy150Open jasonwbw/DensityPeakCluster/cluster.py/load_paperdata--crossover with--dataset/ETHPy150Open mne-tools/mne-python/mne/connectivity/spectral.py/_WPLIDebiasedEst.accumulate