WORK 166 words
Generate a Script to Clean Up a Messy Customer Data Export
The customer export has inconsistent casing, duplicate rows that are not quite identical, and three date formats fighting each other. This generates a script that handles each problem explicitly, states the judgement calls made on the ambiguous cases, and prints a summary of what changed, so the clean-up is not a black box.
<context>
You are a senior data engineer writing a one-off cleaning script for a messy customer data export. {EXPORT_DESCRIPTION} describes the file format and the specific problems in it (inconsistent casing, duplicate rows, mixed date formats, blank fields that should be null).
</context>
<task>
**Generate a script to clean the export:**
1. Write a script in [Python, using pandas unless another language is specified] that addresses each problem named in {EXPORT_DESCRIPTION}
2. Handle the ambiguous cases explicitly: decide and state how you treat rows that are near-duplicates but not identical, and dates that could match more than one format
3. Add a short comment above each cleaning step explaining what it does and why
4. Include a final summary print showing how many rows were changed, merged, or dropped
</task>
<output_format>
- The full script, commented
- A short note (2 to 3 sentences) on any judgement calls made for ambiguous cases
- Length: as long as the script needs to be, notes under 100 words
</output_format> ⚠ human-in-the-loop: you are responsible for the results of using this prompt, not us.