今天我们学习下如何用python快速生成股权架构图,过程比较简单,比较适合刚学习python的朋友练习。
![a04bfe82c62334b0d5b979d2305e5a7e.png](https://img-blog.csdnimg.cn/img_convert/a04bfe82c62334b0d5b979d2305e5a7e.png)
比如,我们的想法是将在Excel中填写好的关系数据维护好后,一键生成对应的股权架构图。
代码
#!/usr/bin/env python3
# -*- coding:UTF-8 -*-
# Author: nigo
from graphviz import Digraph
import pandas as pd
def read_excel(path,sheet_name):
"""TODO: 读取excel工作表数据
:path: 文件路径
:sheet_name: 工作表名称
:returns: 表数据pd
"""
df = pd.read_excel(path,sheet_name,index_col=None, keep_default_na=False)
return df
i