Choosing columns

We can also choose to read only a subset of columns. This is done by setting the parse_cols option to a numeric value, which will lead to columns being read from 0 to whichever index we set the parse columns value to. We set parse_cols=2 in this instance, which reads the first three columns in the Excel file, as shown in the following code snippet:

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

The following is the output:

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.