直接to_excel会被覆盖,借助ExcelWriter可以实现写多个sheet。
from openpyxl import load_workbook
excelWriter = pd.ExcelWriter(os.path.join(output_dir, 'datapoint_statistic.xlsx'),
engine='openpyxl')
pd.DataFrame().to_excel(os.path.join( output_dir,'datapoint_statistic.xlsx'))
#excel必需已经存在,因此先建立一个空的sheet
_e
2022-03-08 18:19:33
30KB
AND
AS
c
1