io.py 文件源码

python
阅读 37 收藏 0 点赞 0 评论 0

项目:Taskpacker 作者: Edinburgh-Genome-Foundry 项目源码 文件源码
def tasks_to_spreadsheet(tasks, filepath):
    import pandas
    df_tasks = pandas.DataFrame.from_records([
        task.to_dict()
        for task in tasks
    ])
    resources = set(resource for task in tasks for resource in task.resources)
    df_resources = pandas.DataFrame.from_records([
        resource.to_dict()
        for resource in resources
    ])

    with pandas.ExcelWriter(filepath, engine='xlsxwriter') as writer:
        df_tasks.to_excel(writer, sheet_name='tasks', index=False)
        df_resources.to_excel(writer, sheet_name='resources', index=False)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号