Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

networkx remove attributes

In [1]: import networkx as nx

In [2]: G = nx.Graph()

In [3]: G.add_node(1,color='red')

In [4]: G.node[1]['shape']='pear'

In [5]: list(G.nodes(data=True))
Out[5]: [(1, {'color': 'red', 'shape': 'pear'})]

In [6]: del G.node[1]['color']

In [7]: list(G.nodes(data=True))
Out[7]: [(1, {'shape': 'pear'})]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #networkx #remove #attributes
ADD COMMENT
Topic
Name
5+4 =