将因果矩阵转为连接矩阵(骨架)
import numpy as np
causal = np.loadtxt('stand_50nodes.txt')
rows = causal.shape[0]
cols = rows
skeleton = np.zeros((cols, cols), dtype=int)
for i in range(rows):
for j in range(cols):
if causal[i][j] == 1:
skeleton[j][i] = 1
skeleton[i][j] = 1
np.savetxt('skeleton.txt', skeleton, fmt='%d')