Data cleaning plan for a messy dataset
Describe your messy data and get a prioritized cleaning plan with rules, code and a record of every change you make.
Describe the transformation or analysis you need and get clean, commented pandas code that handles messy data and explains each step.
Write Python pandas code for the following task.
Task: {{task}}
My DataFrame (name, columns with types, and a few sample rows):
{{dataframe}}
Output I want: {{output}}
Guidelines:
- Start with two or three lines on your approach and any assumptions about the data. If an assumption could change the result, say how, and ask me at the end.
- Write idiomatic, readable code using method chaining where it stays clear. No loops over rows unless unavoidable. No deprecated functions.
- Handle the real-world issues likely in this data: missing values, wrong dtypes, duplicate rows, inconsistent text casing, and time zones. Do not silently drop rows; if rows are removed, print how many.
- Add short comments explaining why, not what.
- Include a tiny runnable example with 4-6 made-up rows so I can check the logic before I run it on the full data.
- End with "How to check it": 2-3 assertions or quick checks (row counts, totals, null counts) I can add.
Format: Approach, Code (one block), Example output, How to check it, Questions.Asking for a tiny runnable example and assertions makes the output verifiable rather than just plausible. Pasting 3-5 real rows greatly reduces dtype and format mistakes.
Licensed CC0 (public domain) Version 1 · history
Describe your messy data and get a prioritized cleaning plan with rules, code and a record of every change you make.
Describe your tables and the question you need answered and get a correct, commented SQL query with assumptions spelled out.
Turn a dataset description into a step-by-step exploration plan with checks, hypotheses and the first charts to make.
Paste a regression table and get a careful interpretation of coefficients, fit and reliability, with warnings about causal claims.
Convert raw findings and numbers into a short, decision-ready summary with the answer first, evidence, caveats and next steps.
Set up a proper cohort retention analysis, from defining cohorts and the activity event to producing the table and reading it correctly.
Comments (0)
Sign in to join the discussion.
No comments yet. Be the first to share how it worked.