Nov-20-2018, 06:40 PM
I need to automate the creation of around 1000 excel workbooks. The workbook will contain three tabs.
TAB 1 = Overview and instructions for fund holders. Will be the same for all xlsx.
TAB 2 = Grant Transactions
TAB 3 = Gift Transactions
I have two large csv files, one for each type of transaction (Gift/Grant).
Gist:
Open (as pandas.dataFrame) a static csv file containing transaction history for around 1000 fund accounts;
Save headers as variables to be used on all workbooks;
Use groupby on csv['fund_id'] and apply the unique values to a list.
Iterate through df using list values.
for each: initiate/open workbook object as ('Fund_nm'_'Fund_ID'.csv), initiate/open worksheet object with name 'Grants', write headers, write row values, close (save) worksheet.
I would like to write one excel workbook (.xlsx)for each fund account.
This means I will either have to write all three worksheets at once (intro tab, grant tab, gifts tab) or I will have to update xlsx when creating sheets two and three.
I have used xlsxWriter and pyexcel to write single workbooks. I am needing some help thinking through how to accomplish this task.
Objective: create ~1000 excel workbooks containing intro tab (constant across workbooks), grants tab, and gifts tab. I currently have the data in two csv files.
Any help thinking through the logical steps and/or recommending approaches to the task would be greatly appreciated.
TAB 1 = Overview and instructions for fund holders. Will be the same for all xlsx.
TAB 2 = Grant Transactions
TAB 3 = Gift Transactions
I have two large csv files, one for each type of transaction (Gift/Grant).
Gist:
Open (as pandas.dataFrame) a static csv file containing transaction history for around 1000 fund accounts;
Save headers as variables to be used on all workbooks;
Use groupby on csv['fund_id'] and apply the unique values to a list.
Iterate through df using list values.
for each: initiate/open workbook object as ('Fund_nm'_'Fund_ID'.csv), initiate/open worksheet object with name 'Grants', write headers, write row values, close (save) worksheet.
I would like to write one excel workbook (.xlsx)for each fund account.
This means I will either have to write all three worksheets at once (intro tab, grant tab, gifts tab) or I will have to update xlsx when creating sheets two and three.
I have used xlsxWriter and pyexcel to write single workbooks. I am needing some help thinking through how to accomplish this task.
Objective: create ~1000 excel workbooks containing intro tab (constant across workbooks), grants tab, and gifts tab. I currently have the data in two csv files.
Any help thinking through the logical steps and/or recommending approaches to the task would be greatly appreciated.