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"
#10
(Mar-11-2021, 04:00 PM)buran Wrote: OK. Here is the solution - specify mode to be 'a', append
writer = pd.ExcelWriter(filename, engine='openpyxl', mode='a')
Alternatively, look at this one or this one where it loads the file before instantiating the pd.ExcelWriter.

I also post an answer on SO. I will appreciate if you upvote/accept the answer there

thanks buran I answered you on my post on stack overflow. If you check in the comments of the new function I added also your name as contributor.

Contributions to the current helper function: https://stackoverflow.com/users/4046632/...ab=profile


I upvoted you, but since my reputation is less than 15 it doesn't display. If you can vote my as well maybe I'll reach 15 and my upvote on you will turn visible.


thanks for the support
Reply


Messages In This Thread
RE: Export dataframe to xlsx - Error "zipfile.BadZipFile: File is not a zip file" - by Baggio - Mar-12-2021, 12:39 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Errors if an xlsx file has blank rows in the beginning…. tester_V 1 981 Aug-28-2023, 06:22 PM
Last Post: deanhystad
  Creating a Dataframe from Zenodo zip file with multiple CSVs about Spotify man0s 0 1,445 Apr-26-2022, 01:45 PM
Last Post: man0s
  export dataframe to file.txt dramauh 5 2,155 Apr-21-2022, 01:23 AM
Last Post: sarahroxon7
  How to form a dataframe reading separate dictionaries from .txt file? Doug 1 4,371 Nov-09-2020, 09:24 AM
Last Post: PsyPy
  strange error from pandas dataframe djf123 1 4,226 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,417 Jul-15-2020, 06:20 PM
Last Post: pawanmtm
  Fatal Python error: initfsencoding: unable to load the file system codec gauravbhardwajee 12 28,610 Apr-30-2020, 07:45 PM
Last Post: barrpath
  error bars with dataframe and pandas Hucky 4 4,483 Apr-27-2020, 02:02 AM
Last Post: Hucky
  error : value of a DataFrame is ambiguous Sonata 1 2,363 Apr-24-2020, 05:40 PM
Last Post: anbu23
  XLSX file with multiple sheets to josn file ovidius 2 2,364 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