title: Load multiple excel sheets into mysql
body: <p>I have multiple excel files which inturn have multiple sheets in them I am trying to load them into mysql database
  Below is my working code for excel with one sheet</p>
  
  <pre><code>import pandas as pd
      df = pd.read_excel(open(path+ "/" +file, 'rb'), sheet_name='Sheet1')
                        table_name = "sample"
                        # Defaulting null values to 0 .
                     df=df.fillna(0)
                   # inserting the data.
                     df.to_sql(con=engine, name=table_name, if_exists='replace', schema=None)
  </code></pre>
  
  <p>The above code works but one problem
  1. I am hard coding the table name ideally i would like to have the same name as excel file I can probably use split and just get file name is there a better way to get the file name without extension.</p>
  
  <p>but the real problem is here</p>
  
  <p>Now in my folder there can be multiple excel files with mulyiple sheets inside them
  example document1.xlsx(with two sheets inside it sheet1 and sheet2)
  This is what I did</p>
  
  <pre><code>    xls = pd.ExcelFile('document1.xlsx')
                  sheets = []
                  sheets = xls.sheet_names
                  #type(sheets)
                  #print(sheets)this gives me list containing sheet1,sheet2
                  for i in sheets:
                      #print(i) 
                      df = pd.read_excel(open(path+ "/" +file, 'rb'), sheet_name=i)
     df.to_sql(con=engine, name=table_name, if_exists='replace', schema=None)
  </code></pre>
  
  <p>In the above code the data frame saves both sheets data but i want to store sheet 1 data first load it into a table then take the second sheet and load it into an another table so in the above df i did this change to see if code is working
  pd.read_excel(open(path+ "/" +file, 'rb'), sheet_name=i[0]) but it doesnt work any ideas?? </p>
  
  <p>Thankyou</p>