Summarizing Artifact Views
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?
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.
Step 2 extracts the month from the date, which automatically sorts the dataset and prevents Step 3 from calculating an accurate sum.
Step 3 calculates the sum before Step 4 filters for October, resulting in a total view count for all months instead of just October.
Step 1 filters the categories before Step 2 extracts the month, which deletes the date information needed for the final summary.
Question Leaderboard
Not enough data yet to show leaderboard.
