lizitingxue

有些时候从系统里导出多年份的数据,我们需要合并在一个表中,合并前的数据:

合并后的效果:

附上代码:

import pandas as pd
year = [\'2014\',\'2015\',\'2016\',\'2017\',\'2018\']
with pd.ExcelWriter(\'C:/Users/laura/Desktop/test/技术经济指标汇总.xlsx\') as writer:
    for i in range(len(year)):
        sheet = pd.read_excel(\'C:/Users/laura/Desktop/test/\'+year[i]+\'年技术经济指标.xlsx\',sheet_name= \'Sheet1\',header= 0)
        sheet.to_excel(writer, sheet_name=year [i]) 

有问题欢迎留言哦~~^_^

posted on 2020-04-03 20:36  栗子听雪  阅读(552)  评论(0编辑  收藏  举报

分类:

技术点:

相关文章:

  • 2021-12-19
  • 2021-12-29
  • 2021-12-27
  • 2021-12-29
  • 2021-12-29
  • 2021-12-27
  • 2021-12-13
猜你喜欢
  • 2021-12-29
  • 2021-12-29
  • 2021-11-01
  • 2021-11-13
  • 2021-12-27
相关资源
相似解决方案