Specifying which sheet should be read

To specify which sheet should be read, pass the value to the sheetname option. As you can see in the following screenshot, we are simply passing 0, which is the index value of the first sheet in the Excel sheet. This is quite handy, especially when we don't know the exact sheet name:

df = pd.read_excel('IMDB.xlsx', sheetname=0)df.head()

The output is as follows:

Get Mastering Exploratory Analysis with pandas now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.