Importing modules

First, we will start by importing the pandas module with the following command:

import pandas as pd

To read the CSV files, we use the read_csv method, as follows:

df = pd.read_csv('IMDB.csv', encoding = "ISO-8859-1")df.head()

In order to perform a basic import, pass the filename of the dataset to read_csv, and assign the resulting DataFrame to a variable. In the following screenshot, we can see that pandas has turned the dataset into a tabular format:

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.