title: sheeting excel sheet after user id using a for loop
body: <p><a href="https://i.stack.imgur.com/yrMoA.png" rel="nofollow noreferrer"><strong>Data</strong></a></p>
  <p>Given the data above, I want to be able to name each excel sheet by the id. But the code only names sheet after last id.</p>
  <p>Here is my code:</p>
  <pre><code>import pandas as pd
  import xlsxwriter
  
  df_dummy = pd.read_csv('dummy.csv') 
  
  id_store = df_dummy['id'].unique()
  
  for i in id_store:
      print (i)
      workbook_dummy = xlsxwriter.Workbook('store_dummy.xlsx')
      worksheet = workbook_dummy.add_worksheet('store {}'.format(i))
      workbook_dummy.close()
  
  </code></pre>