赞
踩
@创建于:20211118
如果只是想把一个DataFrame保存为单独的一个Excel文件,那么直接写:
df_data.to_excel('xxx.excel', 'sheet1', index=False)
if not os.path.exists(file_path):
df_data_save.to_excel(file_path, 'SelectData', index=False)
else:
with pd.ExcelWriter(file_path, engine='openpyxl', mode='a') as writer:
df_data_save.to_excel(writer, 'new_sheet', index=False)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。