How to Load Multiple Excel Sheets in Pandas
Pass sheet_name=None to pd.read_excel and pandas returns a dictionary with one DataFrame per worksheet, keyed by the sheet name. When the sheets are laid out differently, loop over pd.ExcelFile(...).sheet_names and use parse with arguments per sheet. pd.concat then merges all sheets into one DataFrame.
Load all sheets at once
With sheet_name=None, one read_excel call reads every worksheet. My example workbook has six sheets with sales records, one per country, and the result is a dictionary whose keys are the six sheet names.
from pathlib import Path
import pandas as pd
# Define filepath
current_dir = Path(__file__).parent if "__file__" in locals() else Path.cwd()
excel_filepath = current_dir / "data.xlsx"
# Set sheet_name to 'None'
df_dict = pd.read_excel(excel_filepath, sheet_name=None)
df_dict
keys() lists the sheet names, and get with a sheet name returns that sheet’s DataFrame.
# Check all sheet names
df_dict.keys()
# Access sheets by their name
df_dict.get("Germany")
# ...but there will be an issue, if the data in each sheet is located in a different position
df_dict.get("India")
dict_keys(['Germany', 'Canada', 'United States Of America', 'Mexico', 'France', 'India'])
The catch: pandas assumes every table starts in cell A1. In my workbook the India table starts in B2, one column to the right and one row down, so its DataFrame gets an empty column and the wrong headers. You could clean that up afterwards, but it is easier to read the sheet correctly from the start.
Sheets that start in different places
pd.ExcelFile opens the workbook once and lists its sheet names. You then read each sheet with parse, which takes the same arguments as read_excel, so every sheet can get its own settings.
from pathlib import Path
import pandas as pd
# Define filepath
current_dir = Path(__file__).parent if "__file__" in locals() else Path.cwd()
excel_filepath = current_dir / "data.xlsx"
# Load the Excel file
xl_file = pd.ExcelFile(excel_filepath)
# Now you can list all sheets in the file
xl_file.sheet_names
['Germany', 'Canada', 'United States Of America', 'Mexico', 'France', 'India']
I keep the per-sheet arguments in two dictionaries: usecols for the columns to read and skiprows for the rows to skip at the top. .get(sheet_name, None) falls back to the pandas default for every sheet that is not listed. Here Germany and France read only some columns, and India reads columns B to P and skips its empty first row.
# Create dicts for the arguments
usecols = {
"Germany": "A,C,E:F",
"France": "B:B",
"India": "B:P",
}
skiprows = {
"India": 1
}
# Use additional arguments to read the sheets
df_dict_flex = {}
for sheet_name in xl_file.sheet_names:
df_dict_flex[sheet_name] = xl_file.parse(sheet_name,
usecols=usecols.get(sheet_name, None),
skiprows=skiprows.get(sheet_name, None),
)
df_dict_flex
df_dict_flex.get("Germany").head()
df_dict_flex.get("India").head()
The result is a dictionary with the same structure as before, but the Germany DataFrame holds only the chosen columns and the India DataFrame has the right headers.
Merge all sheets into one DataFrame
To stack all sheets into one table, pass the dictionary’s values to pd.concat. Only India needs special arguments here, because the other sheets already have the same columns. Printing the unique values of the Country column confirms that every sheet made it in.
from pathlib import Path
import pandas as pd
# Define filepath
current_dir = Path(__file__).parent if "__file__" in locals() else Path.cwd()
excel_filepath = current_dir / "data.xlsx"
# Load the Excel file
xl_file = pd.ExcelFile(excel_filepath)
# Create dicts for the arguments
usecols = {
"India": "B:P",
}
skiprows = {
"India": 1
}
# Use additional arguments to read the sheets
df_dict_flex = {}
for sheet_name in xl_file.sheet_names:
df_dict_flex[sheet_name] = xl_file.parse(sheet_name,
usecols=usecols.get(sheet_name, None),
skiprows=skiprows.get(sheet_name, None),
)
df_dict_flex
df_merged = pd.concat(df_dict_flex.values(), ignore_index=True)
df_merged
df_merged["Country"].unique()

If your sheets are messier than a few extra columns, with titles, notes and blank rows, see how to read messy Excel files with pandas. To write DataFrames back to Excel, follow export pandas DataFrames to a new or existing workbook. For practice data, my free Excel dataset generator creates sample tables you can split across sheets.
