def write_node_attributes(graph, filename):
# utility function to let you print the node + various attributes in a csv format
for node in graph.nodes(data=True):
# print graph.report_node_data(undir_g)
node_idx, node_dict = node
attrs = ','.join(str(v) for v in node_dict.values)
print node # nx.get_node_attributes(graph, node_idx) #, ",", ",".join(vals)
评论列表
文章目录