import pandas as pd
new1 = pd.DataFrame({0:['a','b','c'], 1:['q1','q2','q3'], 2:['t3','t2','t1']})
new2 = pd.DataFrame({0:['aq1','bq2','cq3'], 1:['la1','la2','la3']})
with pd.ExcelWriter('a.xls') as writer:
new1.to_excel(writer, 'sheet1')
new2.to_excel(writer, 'sheet2')
Python with pd.ExcelWriter(‘a.xls‘) as writer: 新建excel文件,保存2个sheet
最新推荐文章于 2025-03-21 09:54:47 发布