Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
guipsamora
GitHub Repository: guipsamora/pandas_exercises
Path: blob/master/10_Deleting/Iris/Exercises.ipynb
613 views
Kernel: Python 2

Iris

Introduction:

This exercise may seem a little bit strange, but keep doing it.

Step 1. Import the necessary libraries

Step 2. Import the dataset from this address.

Step 3. Assign it to a variable called iris

Step 4. Create columns for the dataset

# 1. sepal_length (in cm) # 2. sepal_width (in cm) # 3. petal_length (in cm) # 4. petal_width (in cm) # 5. class

Step 5. Is there any missing value in the dataframe?

Step 6. Lets set the values of the rows 10 to 29 of the column 'petal_length' to NaN

Step 7. Good, now lets substitute the NaN values to 1.0

Step 8. Now let's delete the column class

Step 9. Set the first 3 rows as NaN

Step 10. Delete the rows that have NaN

Step 11. Reset the index so it begins with 0 again

BONUS: Create your own question and answer it.