Skip to content

Instantly share code, notes, and snippets.

View rtbs-dev's full-sized avatar
💮

Rachael Sexton rtbs-dev

💮
View GitHub Profile
@rtbs-dev
rtbs-dev / nx2gt.py
Last active June 11, 2018 16:43 — forked from bbengfort/nx2gt.py
Convert a networkx to graph-tool graph
import networkx as nx
def nx2gt(nxG):
"""
Converts a networkx graph to a graph-tool graph.
"""
# Phase 0: Create a directed or undirected graph-tool Graph
import graph_tool as gt
gtG = gt.Graph(directed=nxG.is_directed())