import pandas as pd
xl_dict = {}
sheetname_list = ['2018', '2019', '2020']
#i am able to get the sheets from here
for sheet in sheetname_list:
xl_dict[sheet] = pd.read_excel('Mvvvv Ds.xlsx', sheet_name=sheet)
print(xl_dict[sheet].title)
无法在此文件中添加工作表,我想在此文件中添加添加这三张工作表。
path2 = '2020-01-29.xlsx'
答案 0 :(得分:0)
我认为您应该签出Excel Writer。
writer = pd.ExcelWriter(path2)
[xl_dict[sheetname_list[x]].to_excel(writer,sheet_name=sheetname_list[x]) for x in range(len(sheetname_list))]
writer.save()