title: pd.read_excel in Python
body: <p>i'm currently using read_excel to access my excel file and i have assigned variables to each column in the work sheet by referring to the first cell object of the column(<em>column headings in the excel sheet</em>). Now this works fine and i have been able to sort data in each column just by referring to the variables i assigned. However when i add the sheetname argument to read_excel so as to apply my sorting code to other sheets in the excel file with identical column placements and first cell objects(<em>column heading in the excel sheet</em>), i get an error. What do i do?</p>
  
  <pre><code>import pandas as pd
  #import numpy as np
  import matplotlib.pyplot as plt
  from matplotlib import style
  style.use('ggplot')
  #import os
  #import collections
  from collections import defaultdict
  #import pylab as pl
  #import xlrd
  import warnings; warnings.simplefilter('ignore')
  
  # reading the excel sheet
  df = pd.read_excel('file_path.xlsx') 
  
  
  # assigning variables to each column
  gender = df['Gender']
  name = df['Name']
  age = df['Age']
  district = df['District']
  school = df['School']
  private_public = df['Is your school']   
  settlement_type = df['Type of settlement']
  </code></pre>
  
  <p>i get this error message </p>
  
  <p><em>File "C:/Users/qanda/OneDrive/Documents/Python Scripts/PEN/pen_data_man.py", line 25, in 
      gender = df['Gender']
  KeyError: 'Gender'</em> </p>
  
  <p>when i add <em>sheetname=None</em> </p>
  
  <pre><code>df = pd.read_excel('file_path.xlsx') 
  </code></pre>
  
  <p>to </p>
  
  <pre><code>df = pd.read_excel('file_path.xlsx', sheetname=None) 
  </code></pre>