逐行绘制pandas excel表

时间:2018-06-03 15:53:56

标签: python excel pandas graphviz

我试图逐行绘制Excel表格的行,我一次得到结果图表,但是,我想逐步看到绘图。在不同的视图上,不是一次全部。我的Excel工作表由三列(源,目标和标签)组成。

这是代码:

df = pd.read_csv('draw1.csv',header=None)

print (df)

g = Digraph (comment='Messages_Exchanged')

g.attr(bgcolor='lightblue1')

g.attr('node', shape='box')

g.attr(fontsize='14')

g.edge( 'I',RIDO[0],lable)

g.attr(rankdir='LR', size='8,7')

g.attr(size='10,10')

g.node_attr.update(color='blue2', style='filled')

g.view()

for index,col in df.iterrows():

    g.edge(str(col[0]), str(col[2]),str(col[1]))

    g.render ('graph.gv', view=True)

for index,col in df.iterrows():

    g.edge(str(col[0]), str(col[2]),str(col[1]))

    g.view()

0 个答案:

没有答案