Python Forum
Export dataframe to xlsx - Error "zipfile.BadZipFile: File is not a zip file"
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Export dataframe to xlsx - Error "zipfile.BadZipFile: File is not a zip file"
#7
I don't see how this could be related to writing part, because the error is raised at the time when you try to load the file you want to append to, before anything else.
Even in the unlikely case the user on SO is right that [in general] pandas overwriting existing file with a empty one may produce an error somehow, this is not your case - you load a xlsx workbook, append a sheet with data and try overwrite the file you read with the updated file. You don't overwrite with empty file.

Did you try with different file? Is there something different (apart from updated python/packages) compared to when it was working?
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
RE: Export dataframe to xlsx - Error "zipfile.BadZipFile: File is not a zip file" - by buran - Mar-11-2021, 02:10 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Errors if an xlsx file has blank rows in the beginning…. tester_V 1 974 Aug-28-2023, 06:22 PM
Last Post: deanhystad
  Creating a Dataframe from Zenodo zip file with multiple CSVs about Spotify man0s 0 1,442 Apr-26-2022, 01:45 PM
Last Post: man0s
  export dataframe to file.txt dramauh 5 2,143 Apr-21-2022, 01:23 AM
Last Post: sarahroxon7
  How to form a dataframe reading separate dictionaries from .txt file? Doug 1 4,363 Nov-09-2020, 09:24 AM
Last Post: PsyPy
  strange error from pandas dataframe djf123 1 4,220 Jul-27-2020, 05:25 AM
Last Post: scidam
  Filter data based on a value from another dataframe column and create a file using lo pawanmtm 1 4,413 Jul-15-2020, 06:20 PM
Last Post: pawanmtm
  Fatal Python error: initfsencoding: unable to load the file system codec gauravbhardwajee 12 28,602 Apr-30-2020, 07:45 PM
Last Post: barrpath
  error bars with dataframe and pandas Hucky 4 4,456 Apr-27-2020, 02:02 AM
Last Post: Hucky
  error : value of a DataFrame is ambiguous Sonata 1 2,358 Apr-24-2020, 05:40 PM
Last Post: anbu23
  XLSX file with multiple sheets to josn file ovidius 2 2,360 Apr-05-2020, 09:22 AM
Last Post: ovidius

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020