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.

CriterionPoints
Correct dictionary keys and supplied values2
DataFrame construction and row/column interpretation1
Correct shape and total quantity1
Explains why list lengths must match1

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.

CriterionPoints
Inspects shape and column types1
Correct combined row filter2
Correct selected columns and deterministic sorting1
Correct positional slice and explanation1

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.

CriterionPoints
Removes only the exact duplicate and preserves source values1
Standardizes text and retains a missing-campus flag1
Parses numbers and checks stated validity rules1
Separates accepted rows from an informative exclusion audit1
Explains the policy without guessing missing measurements1

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.

CriterionPoints
Correct vectorized revenue calculation1
Correct grouping key and readable named aggregations1
Distinguishes order count from units1
Correct campus totals1
Reconciles grouped and original revenue1

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.

CriterionPoints
Correct outer merge on the intended key1
Uses and explains many_to_one validation1
Correct indicator-based audit1
Correct matched and unmatched counts1
Explains nine merged rows versus eight actual orders1

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.

CriterionPoints
Correct pivot_table axes, value, and sum aggregation2
Clearly labeled wide result1
Correct melt to long form1
Reconciles totals and explains repeated keys1

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.

CriterionPoints
Explicit correct datetime parsing1
Correct daily resampling and chronological index1
Correct counts and revenue totals1
Identifies both maximum-revenue days1
Explains timestamp boundary behavior1

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.

CriterionPoints
Correct campus summary1
Readable chart with units and a zero baseline1
Exports CSV without an index and saves the chart1
Reads back and verifies the CSV1
States a supported comparison and a clear limitation1

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.