Created
September 5, 2018 14:35
-
-
Save oro2714/56c5ab33c47ca20e28a40b1a9a13776f to your computer and use it in GitHub Desktop.
This file contains 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 json | |
import os | |
import csv | |
from graphviz import Digraph | |
import pandas as pd | |
graph = [] | |
with open("graph.csv","r") as f: | |
reader = csv.reader(f) | |
for row in reader: | |
graph.append(row) | |
addrs1=[] | |
with open("addres_v5.csv","r") as f: | |
reader = csv.reader(f) | |
for row in reader: | |
addrs1.append(row) | |
addrs=[a[0] for a in addrs1] | |
G = Digraph(format='png') | |
G.attr('node', shape='circle') | |
graph2=[[str(addrs.index(g[0])),str(addrs.index(g[1]))] for g in graph if g[0] in addrs and g[1] in addrs] | |
print(graph2) | |
for i in graph2: | |
G.edge(i[0],i[1]) | |
print("################################") | |
G.render('money_tree') |
This file contains 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 json | |
import os | |
import csv | |
from graphviz import Digraph | |
import pandas as pd | |
graph = [] | |
with open("graph.csv","r") as f: | |
reader = csv.reader(f) | |
for row in reader: | |
graph.append(row) | |
addrs1=[] | |
with open("addres_v5.csv","r") as f: | |
reader = csv.reader(f) | |
for row in reader: | |
addrs1.append(row) | |
addrs=[a[0] for a in addrs1] | |
G = Digraph(format='png') | |
G.attr('node', shape='circle') | |
graph2=[[str(addrs.index(g[0])),str(addrs.index(g[1]))] for g in graph if g[0] in addrs and g[1] in addrs] | |
print(graph2) | |
for i in graph2: | |
G.edge(i[0],i[1]) | |
print("################################") | |
G.render('money_tree') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment