networkx remove attributes

Solutions on MaxInterview for networkx remove attributes by the best coders in the world

showing results for - "networkx remove attributes"
Máximo
17 Feb 2020
1In [1]: import networkx as nx
2
3In [2]: G = nx.Graph()
4
5In [3]: G.add_node(1,color='red')
6
7In [4]: G.node[1]['shape']='pear'
8
9In [5]: list(G.nodes(data=True))
10Out[5]: [(1, {'color': 'red', 'shape': 'pear'})]
11
12In [6]: del G.node[1]['color']
13
14In [7]: list(G.nodes(data=True))
15Out[7]: [(1, {'shape': 'pear'})]
similar questions
queries leading to this page
networkx remove attributes