Skip to content

Instantly share code, notes, and snippets.

@diije
Created May 1, 2018 12:43
Show Gist options
  • Save diije/193ec57d7e1347db91c52699c4f08ccd to your computer and use it in GitHub Desktop.
Save diije/193ec57d7e1347db91c52699c4f08ccd to your computer and use it in GitHub Desktop.
Converting from Networkx to Python-Igraph
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
@JIBarrionuevoGaltier
Copy link

Great! Your solution help me! Thank!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment