A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/7074 below:

ExcelWriter does not support BytesIO input · Issue #7074 · pandas-dev/pandas · GitHub

At least XlsxWriter supports writing to buffers but the ExcelWriter constructors try to read the extension of the supplied path, so it fails when you initialise it as ExcelWriter(buf, engine="xlsxwriter").

Currently you can hack that into pandas using

b = BytesIO()
w = ExcelWriter("data.xlsx", engine="xlsxwriter")
w.book = xlsxwriter.Workbook(b)
df.to_excel(w)
w.save()
b.getvalue()

but it would of course be nice if this just worked out-of-the-box. I'll try to build a PR for that.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4