Dropping missing data
Now that you've explored the volunteer dataset and understand its structure and contents, it's time to begin dropping missing values.
In this exercise, you'll drop both columns and rows to create a subset of the volunteer dataset.
Deze oefening maakt deel uit van de cursus
Preprocessing for Machine Learning in Python
Oefeninstructies
- Drop the
LatitudeandLongitudecolumns fromvolunteer, storing asvolunteer_cols. - Subset
volunteer_colsby dropping rows containing missing values in thecategory_desc, and store in a new variable calledvolunteer_subset. - Take a look at the
.shapeattribute ofvolunteer_subset, to verify it worked correctly.
Praktische interactieve oefening
Probeer deze oefening eens door deze voorbeeldcode in te vullen.
# Drop the Latitude and Longitude columns from volunteer
volunteer_cols = ____
# Drop rows with missing category_desc values from volunteer_cols
volunteer_subset = ____
# Print out the shape of the subset
print(____.____)