Interview practice question
A few malformed rows in a CSV
Data Engineering · Python · Beginner
A CSV from a partner has some malformed rows with extra columns, and your load fails. How do you handle it?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Find the bad rows first, for example with the csv module or on_bad_lines in pandas.
- Decide to skip, fix or quarantine them.
- Write bad rows to a separate file with line numbers.
- Load the good rows if the business agrees.
- Report the issue to the partner.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.