How to read excel file in Python using Pandas

You can read the excel file in Python using Pandas with the following code. I highly recommend you This book to learn Python.

Read Excel File

# Import the Pandas libraray as pd
import pandas as pd

# Read Excel file
data = pd.read_excel('house_price.xlsx')

# Display the Data
print(data)

Output:

   Area  Rooms  House_Age  Price
0  5000      5          5  75000
1  4000      4          5  65000
2  3000      3          1  60000
3  2000      3          1  58000
4  1500      2          1  50000
5  7000      5          5  90000
6  6000      5          3  85000
7  6500      4          7  80000
8  8000      5         15  95000

Free Learning Resources

Leave a Comment

Your email address will not be published.