4 ms·
Pandas doesn't do formatting very well. Using pandas to generate non tabular data is also a non starter. So using pandas to fill out an existing Excel file, say
by rlayton2 5y ago
Pandas doesn't do formatting very well. Using pandas to generate non tabular data is also a non starter. So using pandas to fill out an existing Excel file, say by entering data in specific cells, won't work.
Libraries like xlread and xlwrite can and would be one way to automate such processes. Xlwings can too. I think that Xlwings can do macros where the others can't though
- romeoblade 5y agoExcel is just xml file. What I do is design the excel file how I need it. Export/Save as XML then use jinja2 and template it. First sheet is usually raw data in standard rows/columns, second sheet would have the cells I need, etc a cell for sum of x columns from sheet 1. Then use panda’s to get the data, and feed it through jinja2’s template render function.
- rlayton2 5y agoClever! I've written routines to use xlsxwriter for things like exporting a table to a sheet. It was a fair bit of effort the first time, but now its an easy function call.