In networkx
gr.nodes(data=True)
returns the list of nodes along with the attributes present on each node. Is it possible to get all the neighbors along with attributes of a given node in the graph.
Neighbors function doesn’t accept any optional boolean parameter.
Use the
adjacency_iterif you want to iterate over them oradjacency_listif you want them as a list.Edit
I should add that neither of those will give you the attributes of node. But you can get them easily with
g.node[n].