Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在网络x
gr.nodes(data=True)
返回节点列表以及每个节点上存在的属性。是否可以在图中获取所有邻居以及给定节点的属性。
邻居函数不接受任何可选的布尔参数。
如果adjacency_iter您想迭代它们或者adjacency_list如果您希望它们作为列表,请使用。
adjacency_iter
adjacency_list
编辑
我应该补充一点,这些都不会为您提供节点的属性。但是您可以使用g.node[n].
g.node[n]