我有一个相邻的矩阵类型int32,我想把节点的邻居放在另一个矩阵中我该怎么做?
{adja=nx.adj_matrix(G)
for i in range(len(G)):
neighber_of_node=neighbor1[i]
}
我实际上想将这个matlab代码转换为python,Idont明白了 如何在python中转换邻接(neighber_of_node,neighber_of_node):
{ for i=1:len(adjacency)
neighber_of_node=neighbours[i,:];
neighbor_of_neighbor=adjacency(neighber_of_node,neighber_of_node);}