title: Merging multiple CSV files into separate tabs of a spreadsheet in Python
body: <p>I have a code which generates multiple CSV files in a directory. I want to generate a report in excel which will consist of the CSV files as separate tabs.
  I have used the below code for the same:</p>
  
  <pre><code>import pandas as pd
  import os
  import csv
  import glob    
  path = "/MyScripts"
  all_files = glob.glob(os.path.join(path, "*.csv"))
  df_from_each_file = (pd.read_csv(f) for f in all_files)
  df_from_each_file.to_excel(writer, sheet_name='ReturnData.csv')
  writer.save()
  </code></pre>
  
  <p>But it gives below error:
  <strong>AttributeError: 'generator' object has no attribute 'to_excel'</strong>
  Not sure where i am going wrong. Do i need to import any specific library to solve the issue?</p>
  
  <p><strong>Python Version is 2.7</strong></p>