(Jan-07-2023, 01:20 PM)snippsat Wrote:(Jan-07-2023, 09:13 AM)jacklee26 Wrote: when i run it occur this error, do you know how to fix thisIs not a error just a Warning,if look into it.
FutureWarning: save is not part of the public API, usage can give unexpected results and will be removed in a future version
writer.save()
pandas.ExcelWriter they have deprecatedsave()
so useclose()
instead.
Or better as they advice use writer ascontext manager
,then no need to save or close.
with pd.ExcelWriter('out.xlsx', engine='openpyxl') as writer: df1.to_excel(writer, 'sheet', index=False) df2.to_excel(writer, 'sheet1', index=False)
HI sorry i have one more question to ask,
why is my excel only showing one sheet(sheet1), why is sheet not showing.
I use the print
Quote:print(df1)
print(df2)
it will show
datetime name department 1 20220101 James IT 2 20220101 Test IT datetime name country 1 20220101 James US 2 20220101 Test USbut when opening excel only sheet1 exist, is there any way to also let sheet display.