Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# combine all nodes in a list
node_list = node_list_1 + node_list_2
# remove duplicate items from the list
node_list = list(dict.fromkeys(node_list))
# build adjacency matrix
adj_G = nx.to_numpy_matrix(G, nodelist = node_list)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.