Data_Frame = pd.DataFrame(values)
with pd.ExcelWriter("sam.xlsx", mode='a', engine='openpyxl') as writer:
Data_Frame.to_excel(writer, header=False, index=False)
This is part of my code.
After writing and executing the code, the file becomes unusable.
(There's a message like "There is a problem with the content of 'sam.xlsx'")
Also remove ExcelWriter mode, like this
<with pd.ExcelWriter("sam.xlsx", engine='openpyxl') as writer:>
and the excel file opens properly without error.
What's wrong with this? I can't even find it on Google.
Please help me.......
question from:
https://stackoverflow.com/questions/65830380/file-unavailable-when-adding-pandas-write-mode-is-append 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…