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
textscores=[45,78,92,60,88,35], threshold=50
Example Output
textPassing scores: [78 92 60 88]
Concepts Covered
Boolean masking.
Related Problems
- Problem 1: Generate Reproducible Random DataEasy · pythonSolve Problem
- Problem 3: Select Specific Elements Using Fancy IndexingEasy · pythonSolve Problem
- Problem 4: Calculate a Matrix's Inverse and Verify ItEasy · pythonSolve Problem