📅  最后修改于: 2022-03-11 15:04:44.054000             🧑  作者: Mango
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'})]