Assume that you have many pandas data frames and you want to save them to a single excel file of many worksheets (tabs). Let’s see how we can do it:
# create the xlswriter and give a name to the final excel # for example Final.xlsx writer = pd.ExcelWriter('Final.xlsx', engine='xlsxwriter') # it is convenient to store the pandas dataframes in a # dictionary, where the key is the worksheet name that you want to give # and the value is the data frame df_dict = {'My_First_Tab': df1, 'My_Second_Tab': df2, 'My_Third_Tab':df3, 'My_Forth_Tab':df4} #iterate over the data frame of dictionaries for my_sheet, dframe in df_dict.items(): dframe.to_excel(writer, sheet_name = my_sheet, index=False) # finaly you have to save the writer # and the Final.xlsx has been created writer.save()