Assessment rubric and explanations
Review code, interpretation, and the reasoning behind each choice.
A01. Build the table from a dictionary · 5 points
The dictionary maps column names to equal-length lists. Each row is one fictional order with one item type. The table has three rows, four columns, and six units ordered. Columns must line up by list position.
| Criterion | Points |
|---|---|
| Correct dictionary keys and supplied values | 2 |
| DataFrame construction and row/column interpretation | 1 |
| Correct shape and total quantity | 1 |
| Explains why list lengths must match | 1 |
A02. Inspect, select, filter, and sort · 5 points
The original table has eight rows and six columns. Four RAK orders meet the quantity rule. C007 comes first with four units, followed by C003 with three. C001 precedes C005 because their quantities tie and IDs are sorted ascending.
| Criterion | Points |
|---|---|
| Inspects shape and column types | 1 |
| Correct combined row filter | 2 |
| Correct selected columns and deterministic sorting | 1 |
| Correct positional slice and explanation | 1 |
A03. Clean with an audit trail · 5 points
Nine raw rows become eight after removing one exact duplicate. C003 has an unparseable quantity, C005 lacks a price, and C006 has zero quantity under the stated positive-quantity rule. Five orders remain. Their known revenue would total AED 75. C007 remains because its quantity and price are valid; its unknown campus must stay visible in any campus report. "Unknown" is a label, not a recovered location.
| Criterion | Points |
|---|---|
| Removes only the exact duplicate and preserves source values | 1 |
| Standardizes text and retains a missing-campus flag | 1 |
| Parses numbers and checks stated validity rules | 1 |
| Separates accepted rows from an informative exclusion audit | 1 |
| Explains the policy without guessing missing measurements | 1 |
A04. Calculate revenue and summarize by campus · 5 points
RAK has four orders, eleven units, and AED 95 revenue. Dubai has four orders, six units, and AED 60 revenue. Total revenue is AED 155 from seventeen units. These are revenues before considering any costs; they are not profits.
| Criterion | Points |
|---|---|
| Correct vectorized revenue calculation | 1 |
| Correct grouping key and readable named aggregations | 1 |
| Distinguishes order count from units | 1 |
| Correct campus totals | 1 |
| Reconciles grouped and original revenue | 1 |
A05. Join tables and account for unmatched rows · 5 points
Six order rows match the catalog. Two Sandwich orders are left_only because the catalog lacks Sandwich. Juice is one right_only catalog row. The outer merge has nine rows but still represents eight orders; the extra catalog-only row is not a transaction. The menu must be unique on Item for many_to_one validation.
| Criterion | Points |
|---|---|
| Correct outer merge on the intended key | 1 |
| Uses and explains many_to_one validation | 1 |
| Correct indicator-based audit | 1 |
| Correct matched and unmatched counts | 1 |
| Explains nine merged rows versus eight actual orders | 1 |
A06. Reshape without losing the total · 5 points
The wide table has two campus rows and three item columns. RAK totals are Coffee 20, Sandwich 45, Tea 30; Dubai totals are Coffee 40, Sandwich 15, Tea 5. Melting yields six Campus-Item rows with the same AED 155 total. Ordinary pivot cannot aggregate repeated Campus-Item keys. Filling absent combinations with zero is appropriate here only under the exercise assumption that the provided order list is complete.
| Criterion | Points |
|---|---|
| Correct pivot_table axes, value, and sum aggregation | 2 |
| Clearly labeled wide result | 1 |
| Correct melt to long form | 1 |
| Reconciles totals and explains repeated keys | 1 |
A07. Parse timestamps and summarize each day · 5 points
Daily revenue is AED 20, 50, 35, and 50 on October 1 through 4. Each day has two orders. October 2 and October 4 tie for the maximum. A filter for the complete period through October 4 can use timestamps >= October 1 and < October 5, preserving all October 4 times.
| Criterion | Points |
|---|---|
| Explicit correct datetime parsing | 1 |
| Correct daily resampling and chronological index | 1 |
| Correct counts and revenue totals | 1 |
| Identifies both maximum-revenue days | 1 |
| Explains timestamp boundary behavior | 1 |
A08. Make a readable chart and export the result · 5 points
The chart compares AED 60 for Dubai with AED 95 for RAK. RAK exceeds Dubai by AED 35 in the supplied records. CSV export with index=False keeps only the intended two columns. The result describes fictional revenue, not profit, demand, or a forecast. Re-running the task replaces only its two named output files.
| Criterion | Points |
|---|---|
| Correct campus summary | 1 |
| Readable chart with units and a zero baseline | 1 |
| Exports CSV without an index and saves the chart | 1 |
| Reads back and verifies the CSV | 1 |
| States a supported comparison and a clear limitation | 1 |
Questions for a short discussion
In your cleaning task, which records were excluded and why did you keep the missing-campus order?
C003 has unparseable quantity text, C005 has no unit price, and C006 has zero quantity under the stated positive-quantity rule. C007 can still contribute known revenue; its campus is marked Unknown and flagged as originally missing. Different analysis questions may require different completeness rules.
Your outer merge has nine rows, although there were only eight orders. Where did the extra row come from?
Juice occurs only in the menu. An outer merge preserves it as a right_only row, which is not an order. Sandwich creates two left_only order rows because it is missing from the menu. The merge did not invent a ninth transaction.
Why did you use pivot_table instead of pivot for the revenue matrix?
Some Campus-Item combinations have multiple orders. pivot requires unique row-column combinations, while pivot_table can aggregate them using sum. The chosen aggregation answers total-revenue questions.
RAK has higher revenue in these records. Does that prove its café is more profitable or that the difference will continue?
No. Revenue is not profit; costs are absent. These are only eight fictional orders over four days, so they do not support a real business conclusion or forecast.