title: Iterate multiple Dataframe and write into excel spreadsheets within an excel xlsxwriter python
body: <p>I am working on writing multiple dataframes in excel spreadsheets within an excel file.
  The dataframes generates using for loop , so in every iteration I get next available dataframe but I can not able to write every dataframe in spreadsheets.
  I could only write the first dataframe in first spreadsheet.
  Below is the code snippet:</p>
  
  <pre><code> writer = pd.ExcelWriter('output.xlsx', engine='xlsxwriter')
      workbook = writer.book
      web_ClassID=df_stag["Web-Class ID"].unique()
            for data_id, df in df_stag.groupby('Web-Class ID'): 
               for workbook_Id in web_ClassID:
                   if workbook_Id == data_id:
                      for index, col in enumerate(df):
                      df.to_excel(writer,sheet_name=workbook_Id,index=False )
                      writer.save()
      workbook.close()
  </code></pre>
  
  <p>Note:
  The webclass_id here is type of object 
  Df_stag: is a dataframe which is grouped by Webclass_id 
  df is the dataframe which I want to write into excel spreadsheets 
  Also, I am creating spreadsheets whenever a new Webclass_id is found , so the tab gets created with corresponding Webclass_id when found.<a href="https://i.stack.imgur.com/FshNv.png" rel="nofollow noreferrer">One file having few tabs</a><a href="https://i.stack.imgur.com/HHuCC.png" rel="nofollow noreferrer">another file having few tabs</a></p>
  
  <p>Output: I want a single excel file having all the tabs from all the files and appended data from those file which have same tab in both the files. ie. 11111,22222,33333 and data from 11111 should be from both the files.</p>