ItSolutionStuff.com

Python Read Excel File using Pandas Example

By Hardik Savani • October 30, 2023
Python

Hello Dev,

In this tutorial, you will learn python read excel file using pandas. We will use python read excel file xlsx using pandas. you will learn how to read data from excel file in python using pandas. This article goes in detailed on how to extract data from excel using python pandas.

In this example, we will read excel file using python pandas library. we will use read_excel() function to read excel file date using python pandas. so let's see a simple example.

You can use these examples with python3 (Python 3) version.

I simply created data.xlsx file with content as like below, we will use same file for both example:

demo.xlsx

Example 1: using pandas

main.py

# import pandas library as pd
import pandas as pd
   
# get by default 1st sheet of demo excel file
data = pd.read_excel('demo.xlsx')
   
print(data)

Output:

   ID             Name              Email
0   1    Hardik Savani   hardik@gmail.com
1   2  Vimal Kashiyani    vimal@gmail.com
2   3   Harshad Pathak  harshad@gmail.com

I hope it can help you...

Hardik Savani

Hardik Savani

I'm a full-stack developer, entrepreneur, and founder of ItSolutionStuff.com. Passionate about PHP, Laravel, JavaScript, and helping developers grow.

📺 Subscribe on YouTube

We Are Recommending You

How to Read Excel File in Python?

Read Now →

How to Modify JSON File in Python?

Read Now →

Python Read and Write a JSON File Example

Read Now →

How to Create a JSON File in Python?

Read Now →

Python Read CSV File Line by Line Example

Read Now →

How to Write CSV File in Python?

Read Now →

Python Write CSV File from List Example

Read Now →

How to Check If a List is Empty or Not in Python?

Read Now →

How to Read a Text File in Python?

Read Now →

Python Create Text File If Not Exists Example

Read Now →

Python Create Text File in Specific Directory Example

Read Now →

Python Create Zip Archive from Directory Example

Read Now →

How to Check if Today is Wednesday or not in Python?

Read Now →