Duplicate keys multiply rows (dedupe first); mismatched key formats ("C001" vs "c001 ") silently drop matches (standardise keys); check the row count after every join.
4
New cards
Anti-patterns of wrangling (from the deck).
Dropping missing values without analysis; joining before deduplicating; long one-line chained transformations; ignoring the index (slow look-ups).
5
New cards
to_numeric(errors='raise') vs errors='coerce'?
raise: stop with an error on a bad value. coerce: turn bad values into NaN ('12a' → NaN).
6
New cards
Grouping by Publisher AND Place shows what?
Each publisher–place combination as its own group.
7
New cards
Why set or sort an index?
Faster look-ups and joins on that key.
8
New cards
Feature engineering checklist (five steps).
Derive meaningful variables; encode categories (one-hot / ordinal); scale for distance-based models; log-transform skewed values; remove leakage and IDs.
9
New cards
Which models need scaling and which don't?
Need it: k-NN, k-means, regularised (ridge/lasso) and gradient-based models. Trees and random forests don't.
10
New cards
pandas merge with differently named keys and clashing column names?