Exam PCED-30-02 Topic 1 Question 42 Discussion

Actual exam question for Python Institute's PCED-30-02 exam
Question #: 42
Topic #: 1
You are given two lists representing daily page views and sign-ups on a website:
views = [120, 130, 128, 700, 115, 123, 119, 680, 122]
signups = [12, 15, 13, 50, 11, 14, 10, 55, 13]
You want to:
- remove outliers (views > 600), and
- calculate correlation between the cleaned lists.
Which code accomplishes this correctly? Select the best answer.

Suggested Answer: D Vote an answer

It converts the lists to NumPy arrays, builds a boolean mask based on the views threshold to remove outliers, applies the same mask to both arrays so they stay aligned, and then computes the correlation on the cleaned pairs using np.corrcoef.

by Isaac at May 09, 2026, 08:10 PM

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Nick name: Submit Cancel
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.