I am looking into converting some code from Python NetworkX to Python-IGraph. When adding nodes and edges to a graph, NetworkX very easily allows you to do:
g.add_node(a[0], n=a[1])
where a[0] is the node label and a[1] is the value of the attribute "n". How can we add attributes to a node and similarly to an edge, when creating them with Python-IGraph? Thank you!
3
votes