Promptabide Logo
AN

Amara Nwosu

@amara_nwosu4 months ago

Cleaning Messy CSVs With A Rules-First Prompt

Make it list the rules it will apply before it touches a single row.

data
etl
pandas
data-quality
Keywords:
data cleaning
csv
transformation script
Handing over a messy export and saying "clean this" gets you a cleaned file and no idea what it decided. Dates silently reinterpreted, a whole column dropped because it looked empty in the first 50 rows.

Two-step it:

"Here are the first 200 rows. Do not transform anything yet. List every data quality problem you can see and the rule you would apply for each. Flag any rule where the right choice is ambiguous."

Read the list, correct the two rules that are wrong, then:

"Apply those rules. Output the transformation script, not the transformed data, plus a count of rows affected per rule."

Getting the script rather than the data is the important part — it is reviewable, re-runnable, and works on the full 4M rows rather than the sample.

Attachments (1)

Attachment
7.1k3
Comments (3)
No comments yet. Be the first to share your thoughts!
Top Contributors
Loading...
Follow PromptAbide

New bides, prompt breakdowns and community picks, on whichever feed you already read.

Trending Tags
Loading...
Cleaning Messy CSVs With A Rules-First Prompt | PromptAbide