Loading the Exercise 1 data using Python
For this exercise, use the same iris.csv
file from the previous chapter and open it using any spreadsheet software. We’ll be using Google Sheets in this book to show you how to edit spreadsheet files. In this chapter, you’ll learn how to deal with missing values. The Iris dataset is preprocessed in its original form, so it doesn’t have any missing or invalid values. For this exercise, missing values will be artificially introduced.
Follow these steps to complete this exercise:
- Open the
iris.csv
file. - Randomly delete (as shown in Figure 3.4) some of the cells (6 for this example) for the
sepal_length
row or other columns. - Randomly delete some of the cells for the
petal_length
row. - In the
petal_length
row, addNan
as a term. - Save the file as
Iris_m.csv
. You’ll see the output on the next page:
Figure 3.4 – The Iris dataset as a spreadsheet
You can use...