How to read xls file in Python using Pandas

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

Read XLS File

# Import the Pandas libraray as pd
import pandas as pd

# Read xls file
df = pd.read_excel("score.xls",sheet_name='Sheet1')

# Display the Data
print(df)

Output:

  Students  Score Grade
0    Harry     93     A
1  Richard     80     B
2  Hussain     70     C
3   Satish     85     B
4      Ali     76     C
5    Messi     99     A

Free Learning Resources

Leave a Comment

Your email address will not be published.