Column names

We can choose to give different names to columns instead of the default names given in the header row. To do this, we pass the list of column names to the names parameter, as follows:

df = pd.read_excel('IMDB.xlsx', sheetname=0, parse_cols = 2, names=['X','Title',   'Rating'], )df.head()

In the following screenshot, we have set column names to the names we passed while reading:

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.