Choosing how to earn college credit? CLEP vs AP guide
| preferred AP College board partner for AP classes
AP Computer Science Principles/Big Idea 2: Data
Start Practice TestPractice Test
About Exam
hard

Summarizing Artifact Views

Mark
< Prev
Next >

A small museum maintains a dataset of all digital collection accesses. The dataset includes the columns Date, Artifact_Category, and Views. The director wants to know the total number of views for the Textiles category during the month of October.

A programmer writes a script with the following sequence of operations:

Step 1: Keep only the rows where Artifact_Category is Textiles.

Step 2: Extract the month from the Date column.

Step 3: Sum the Views column for all remaining rows to calculate the total views result.
Step 4: Keep only the rows where the extracted month is October.

Which of the following describes the failure condition in the programmer’s sequence of operations?

A

Step 4 attempts to filter by month after the views have been summed, which will cause the program to crash because the dataset is empty.

B

Step 2 extracts the month from the date, which automatically sorts the dataset and prevents Step 3 from calculating an accurate sum.

C

Step 3 calculates the sum before Step 4 filters for October, resulting in a total view count for all months instead of just October.

D

Step 1 filters the categories before Step 2 extracts the month, which deletes the date information needed for the final summary.

Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question

Question Leaderboard

Not enough data yet to show leaderboard.

No comments yet. Be the first to comment!

AI Tutor

How can I help?

APFIVE © 2020.
Email: apfive@apfive.org|Instagram: @_apfive_|Privacy Policy|