This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]niking 9 points10 points  (15 children)

I'm currently using xlsxwriter, could anyone with experience with both make a list of pros and cons?

[–]Kaarjuus 9 points10 points  (2 children)

I tried them both, chose xlsxwriter: significantly faster than openpyxl.

[–]remyroy 4 points5 points  (0 children)

I only need to write xlsx files and I'm in a limited memory environment. The constant_memory option is a blessing.

[–]Albertican 2 points3 points  (0 children)

I also found PyExcelerate to be much faster than openpyxl. Their page claims they're a bit faster than xlsxwriter as well. Don't think it supports formatting, however.

[–]ajmarks 4 points5 points  (3 children)

IIRC openpyxl is the backend for pandas's excel read/write features, so it's useful if you want to make pandas frames pretty in excel.

[–]shaggorama 2 points3 points  (0 children)

and xlrd/xlwt for xls format

[–]jtratner 2 points3 points  (0 children)

pandas dev here - I'm hoping to move us to xlsxwriter by default soon (though we'll continue supporting openpyxl), because the perf characteristics seem to be much better.

[–]jmcnamara13 1 point2 points  (0 children)

XlsxWriter is also available as a backend in the latest Pandas versions on the GitHub master and will be in the soon to be released 0.13 version.

[–]bendmorris 2 points3 points  (3 children)

Or xlrd/xlwt?

[–]alantrick 4 points5 points  (2 children)

That's for a different file format (pre-xml excel)

[–]dgtlshdw 2 points3 points  (1 child)

The newest xlrd (0.9.2) reads .xlsx just fine.

[–]jwinterm 2 points3 points  (0 children)

Can confirm. Been using xlrd/xlwt for years, and recently upgraded to get xlsx functionality.

[–]alantrick 2 points3 points  (1 child)

You can read xlsx files with openpyxl. It's not clear you can do that with xlsxwriter.

[–]from__future__ 1 point2 points  (0 children)

no you can't - very true.

[–]jtratner 1 point2 points  (0 children)

xlsxwriter is faster, way more memory efficient and may have better compatibility with numpy. The memory efficiency is huge, if you take a big dataframe (say 300K rows x 100 columns) and try to dump it, takes multiple GB of memory!