Created
May 1, 2018 12:43
-
-
Save diije/193ec57d7e1347db91c52699c4f08ccd to your computer and use it in GitHub Desktop.
Converting from Networkx to Python-Igraph
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import networkx as nx | |
Gnx = nx.path_graph(4) # Create a random NX graph | |
nx.write_graphml(G,'graph.graphml') # Export NX graph to file | |
import igraph as ig | |
Gix = ig.read('graph.graphml',format="graphml") # Create new IG graph from file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great! Your solution help me! Thank!