NetworkX

Previous topic

networkx.classes.function.set_edge_attributes

Next topic

networkx.classes.function.freeze

networkx.classes.function.get_edge_attributes

networkx.classes.function.get_edge_attributes(G, name)

Get edge attributes from graph

Parameters :

G : NetworkX Graph

name : string

Attribute name

Returns :

Dictionary of attributes keyed by node. :

Examples

>>> G=nx.Graph()
>>> G.add_path([1,2,3],color='red')
>>> color=nx.get_edge_attributes(G,'color')
>>> color[(1,2)]
'red'