Jun-07-2020, 12:25 PM
(This post was last modified: Jun-07-2020, 12:26 PM by Biplab1985.)
Hi Guys,
I am exporting multiple dataframes to excel template - GMC_template.xlsx which has formulas for further calculations. the below codes works well, when i am exporting the dataframes to each sheet of workbook but does not work when i export the dataframes to workbook template and save with dataframe name. error message -
I am exporting multiple dataframes to excel template - GMC_template.xlsx which has formulas for further calculations. the below codes works well, when i am exporting the dataframes to each sheet of workbook but does not work when i export the dataframes to workbook template and save with dataframe name. error message -
Error:save() takes 1 positional argument but 2 were givencould you assist me if this is right way to do itdfs={"MAY":May_date,"JUN":June_date,"JUL":July_date,"AUG":Aug_date,"SEP":Sep_date,"OCT":Oct_date,"NOV":Nov_date,"DEC":Dec_date,
"YTD":YTD,"Q3":Q3,"Q4":Q4,"HY2":HY2}
pth="Y:\\WEST\\2. BE\\4. MPM Belgium\\2020\\GMC Prep Automation\\Data_Prep_Python\\LEvsLY_Output\\"
Writer =pd.ExcelWriter("GMC_Template.xlsx", engine="xlsxwriter")
for dataset in dfs.keys():
dfs[dataset].to_excel(Writer,index=False,startrow=1,startcol=19,header=False)
Writer.save(os.path.join(pth,dataset))
