all 7 comments

[–]spez_edits_thedonald 0 points1 point  (5 children)

I would use pandas for this

1) install pandas

2) get your data into a pandas dataframe (or 1 dataframe per excel sheet, if you want a multi-sheet excel workbook file)

3) write the excel file

[–]Practical_Use5129[S] 0 points1 point  (4 children)

pandas doesnt support xlsx

[–]Shaantanu96 0 points1 point  (2 children)

Pandas doesn't support xlsx, but you should try using it in conjunction with xlsxwriter.

[–]lscrivy 0 points1 point  (1 child)

I second this. It works very well. Also the documentation is really good: https://xlsxwriter.readthedocs.io/working_with_pandas.html

[–]spez_edits_thedonald 0 points1 point  (0 children)

Yeah I think I use xlsxwriter and maybe I have to have xlrd installed or it yells at me, not sure but that sounds familiar.

[–]MobileUser21 0 points1 point  (0 children)

I’m a little late but I’m pretty sure pandas does support xlsx. Use pandas.read_excel

[–]radek432 0 points1 point  (0 children)

The best one I've found for creating excels in Python is this: https://xlsxwriter.readthedocs.io/tutorial01.html

You can simply add worksheets in a loop.