TDS Archive

An archive of data science, data analytics, data engineering, machine learning, and artificial intelligence writing from the former Towards Data Science Medium publication.

Member-only story

A Simple Trick to Load Multiple Excel Worksheets in Pandas

Zeya LT
4 min readApr 30, 2022

--

Photo by Pexels on Pixabay

In my day-to-day job, I work with Excel files quite a lot — taking Excel files, most of which containing multiple worksheets and loading them into Python using Pandas for a variety of tasks. I found this process to be rather cumbersome, until a fellow co-worker (thanks Gab Lin!) taught me a simple trick that henceforth allows me to do this task more intuitively and efficiently. Allow me to pay it forward in this article!🙂

The codes presented in this article can be found at this GitHub repo.

The Data

Before getting to the crux, let’s first look at the following Excel file which I have created and will be using for illustrations.

Excel file with multiple worksheets (GIF by Author)

It contains fictitious (and very simple) sales data across three consecutive months — January to March. The sales data for each month is shown in separate worksheets.

What I Did Previously And Its Limitations

--

--

TDS Archive
TDS Archive

Published in TDS Archive

An archive of data science, data analytics, data engineering, machine learning, and artificial intelligence writing from the former Towards Data Science Medium publication.

Zeya LT
Zeya LT

Written by Zeya LT

Data Scientist @ Grab • Former Police Officer • Master’s in Data Science & Analytics • Mid-Career Switcher • Father of Two

Responses (7)