Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Append Mode for ExcelWriter with "xlsxwriter" #33264

Closed
engkimbs opened this issue Apr 3, 2020 · 2 comments
Closed

Append Mode for ExcelWriter with "xlsxwriter" #33264

engkimbs opened this issue Apr 3, 2020 · 2 comments
Labels
IO Excel read_excel, to_excel

Comments

@engkimbs
Copy link

engkimbs commented Apr 3, 2020

Problem description

ExcelWriter's append mode doesn't work when setting default xlsxwriter. To use append mode, I have to set the engine openpyxl. I think it is inconvenient and slow. So I suggest ExcelWriter can be set as append mode when default (xlsxwriter).

Sample Code

AS-IS

writer = pd.ExcelWriter('APT_TRADE.xlsx', engine='openpyxl', mode='a')
apt_dataframe.to_excel(writer, sheet_name='city-' + date.strftime("%Y%m"), index=False)

TO-BE

writer = pd.ExcelWriter('APT_TRADE.xlsx', mode='a')
apt_dataframe.to_excel(writer, sheet_name='city-' + date.strftime("%Y%m"), index=False)
@WillAyd
Copy link
Member

WillAyd commented Apr 3, 2020

See this comment from the xlsxwriter maintainer #3441 (comment)

So not possible unless anything has changed that @jmcnamara is aware of

@WillAyd WillAyd added the IO Excel read_excel, to_excel label Apr 3, 2020
@WillAyd WillAyd added this to the No action milestone Apr 3, 2020
@WillAyd WillAyd closed this as completed Apr 3, 2020
@jmcnamara
Copy link
Contributor

@WillAyd You are correct. XlsxWriter doesn’t, and won’t, support rewriting or appending to XLSX files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO Excel read_excel, to_excel
Projects
None yet
Development

No branches or pull requests

3 participants