Choosing a subset of columns to be read

We can also choose to read a specific subset of columns in the CSV file. For this, we pass the column names as a list to use the columns option, as follows:

df = pd.read_csv('IMDB.csv', encoding = "ISO-8859-1", usecols=['Title', 'Genre1'])df.head()

Output of the preceding code snippet 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.