Labeling nodes is subtly annoying for some reason
--Add labeled nodes in bulk
>>> G = nx.Graph()
>>> G.add_nodes_from([(1,{'color':'red'}),(2,{'color':'blue'}),(3,{'color':'red'})])
>>> G.nodes(data=True)
[(1, {'color': 'red'}), (2, {'color': 'blue'}), (3, {'color': 'red'})]
-(Node) Read labeled graph from file
Can not
-(Node) Create a labeled graph from dict or list
Can not
Graphs with labels on edges can be created from files, dicts, and lists, so why can't I create graphs with labels on nodes?
Recommended Posts