Saving multiple dataframes to multiple excel sheets multiple times?
问题 I have a function to save multiple dataframes as multiple tables to single excel workbook sheet: def multiple_dfs(df_list, sheets, file_name, spaces): writer = pd.ExcelWriter(file_name,engine='xlsxwriter') row = 0 for dataframe in df_list: dataframe.to_excel(writer,sheet_name=sheets,startrow=row , startcol=0) row = row + len(dataframe.index) + spaces + 1 writer.save() If I call this function multiple times to write multiple tables to multiple sheets, I end up with just one workbook and one