Specifying a different row as a header

You can also set the column name from a different row—instead of the default first row—by passing the row number to the header option, as follows:

df = pd.read_csv('IMDB.csv', encoding = "ISO-8859-1", header=2)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.