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:

  1. Learn how to load a CSV into an ndarray.
  2. Learn NumPy limitations for working with non-numerical data.
  3. Learn how to use comparison operators in NumPy.
  4. Learn how to use logical operators in NumPy.
  5. 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

  • Learn how to work with various datasets in NumPy.
  • Learn to use Boolean Indexing to select the data you want.

Mission Outline

  1. Introduction
  2. Loading CSV Data
  3. Removing Invalid Data
  4. NumPy Limitations
  5. Comparing Column Values
  6. Comparing with a Single Value
  7. Logical Connectors
  8. Boolean Masks
  9. Boolean Masks in Higher Dimensions
  10. 1D Mask on 2D Array
  11. Next Steps
pandas-fundamentals

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.

START LEARNING FREE

Take a Look Inside