Loading the data

In order to prepare the Python script, it is recommended to create the python file ml.py in the directory containing the dataset file ‘dataset.csv’ and to set it as the working directory in the Python IDE Spyder. Before loading this dataset in our Python script, we have to import the basic packages needed to process the dataset, as shown below :


#importing the libraries
import numpy as n
import matplotlib.pyplot as m
import pandas as p

#loading the dataset
dataset = p.read_csv('dataset.csv').values

By clicking on the variable name in the variable inspector, Spyder displays the following table :

In the next section, we will show how to handle blank cells.