MediumAbout 9 minSemi-structured
Explode a list column into rows
A DataFrame has order_id and skus, where skus is a Python list of product codes per order. Explode it so there's one row per sku, with order_id repeated. An order whose skus list is empty contributes no rows.
Return a list of (order_id, sku) tuples in order.
What the tests check
2 on Run · 3 on Submit01one row per sku, order_id repeated
02an order with no skus produces no rows
Submit runs these and one more check you don’t see, so code written for the visible tests alone can still miss.
Runtime
Python 3.13 in your browser – the standard library plus pandas and numpy; no pip installs.