Given a dataset in a Jupyter notebook, how would you separate it into dimension and fact tables? Implement it using pandas (melt / pivot expected).
Asked in the Jupyter live coding (Python) stage. This was Question 1 of 3 in the pandas round; candidates were advised to keep the model simple and know melt and pivot syntax.
For grading, use the supplied notebook_dataset table as the wide input representation and return its normalized customer-month fact records.
customer_id, customer_name, country, month_start, card_spend, and transfer_count.customer_id, then month_start.| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique customer identifier |
| customer_name | VARCHAR(100) | Customer display name |
| country | VARCHAR(2) | Two-letter customer country code |
| jan_card_spend | NUMERIC(12,2) | Card spending during January 2025 |
| feb_card_spend | NUMERIC(12,2) | Card spending during February 2025 |
| jan_transfer_count | INT | Number of transfers during January 2025 |
| feb_transfer_count | INT | Number of transfers during February 2025 |