Skip to content
CampusEduX

Problem 2: Filter Data Using Boolean Masking

Easypython
Learn the Concept: NumPy (Condensed Reference)

Problem Description

Write a Python program that filters an array of exam scores to show only those above a given passing threshold.

Input

An array of scores and a threshold.

Output

The filtered array of passing scores.

Constraints

  • At least 5 scores.

Example Input

text
scores=[45,78,92,60,88,35], threshold=50

Example Output

text
Passing scores: [78 92 60 88]

Concepts Covered

Boolean masking.

Related Problems

  • Problem 1: Generate Reproducible Random Data
    Easy · python
    Solve Problem
  • Problem 3: Select Specific Elements Using Fancy Indexing
    Easy · python
    Solve Problem
  • Problem 4: Calculate a Matrix's Inverse and Verify It
    Easy · python
    Solve Problem

Input (stdin)

Output

Run your code to see output here...