MISSION 509
Datasets and Boolean Indexing
In the previous mission, we learned about NumPy broadcasting. In this mission, we'll learn how to load data from a CSV into an ndarray. We'll also learn how to extract parts of an ndarray whose values satisfy a specific condition.
In particular, you'll:
- Learn how to load a CSV into an ndarray.
- Learn NumPy limitations for working with non-numerical data.
- Learn how to use comparison operators in NumPy.
- Learn how to use logical operators in NumPy.
- Learn how to use boolean masks to extract parts of the data that satisfy a specific condition.
As with all Dataquest missions, this is an interactive learning experience. You'll be writing real Python code and using NumPy in our browser-based coding environment so there's no setup and no obstacles between you and learning!
Objectives
Mission Outline
- Introduction
- Loading CSV Data
- Removing Invalid Data
- NumPy Limitations
- Comparing Column Values
- Comparing with a Single Value
- Logical Connectors
- Boolean Masks
- Boolean Masks in Higher Dimensions
- 1D Mask on 2D Array
- Next Steps
Course Info:
Intermediate
This is part of our NumPy for Data Engineers course. View Details.
This course includes five missions. It is the ninth course in the Data Engineer path.