for each in G.nodes(data=True):
print each
('a', {'size': 12})
('c', {'size': 50})
('b', {'size': 20})
for each in G.nodes(data=True):
print each[0]
a
c
b
for each in G.nodes(data=True):
print each[1]['size']
125020
边的操作
for each in G.edges(data=True):
print each
('a', 'c', {'weight': 6})
('a', 'b', {'weight': 1})
('b', 'a', {'weight': 5})
('b', 'c', {'weight': 5})
for each in G.edges(data=True):
print each[2]['weight']
6155