Skip to content

Instantly share code, notes, and snippets.

@hagberg
Created October 4, 2010 02:23
Show Gist options
  • Save hagberg/609171 to your computer and use it in GitHub Desktop.
Save hagberg/609171 to your computer and use it in GitHub Desktop.
import networkx as nx
import sys
G=nx.read_gexf(sys.argv[1])
for u,d in G.nodes(data=True):
print(u,d)
for u,v,d in G.edges(data=True):
print(u,v,d)
print(G.graph)
print "G",type(G)
nx.write_gexf(G,'test.gexf')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment