Interview practice question
Row count jumped after a pandas merge
Data Engineering · Python · Intermediate
After merging orders with a product price table in pandas, the row count jumped from 1 million to 1.3 million. What happened?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- The price table has duplicate keys, so orders matched multiple rows.
- Often caused by multiple price versions per product.
- Use validate='many_to_one' to catch it.
- Fix by deduplicating or joining on the correct effective date.
- Check row counts after every merge.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.