title: Assign name to excel sheet from variable in list
body: <p>I have account names that are saved in a python list, let's say &quot;account a&quot;, &quot;account b&quot;, &quot;account c&quot; and so on. This list has been saved in a Pandas dataframe.</p>
  <p>I'd like to have an excel file created for each of those accounts, but I want the file to have the name of the account that it represents.</p>
  <p>My initial thought was to create a for loop and use xlsxwriter, something like this....</p>
  <pre><code>    with pd.ExcelWriter(workbook, engine = 'xlsxwriter') as writer: 
          account_list = ['account a', 'account b', 'account c']
  
  
  
  for account in account_list: 
  
          workbook = xlsxwriter.Workbook([account_list])
          worksheet = workbook.add_worksheet([account_list])
  
          account_list.to_excel(writer, sheet_name = f'[worksheet]')
  </code></pre>
  <p>You can probably guess that I get an error, saying &quot;expected string or bytes-like object.&quot;</p>
  <p>Any thoughts on how to make this work?</p>