Merge and Groupby Results Verification Checklist
Check that joins and aggregations did not change the numbers silently.
The Open buttons send the prompt text as currently shown below to that site only when you click. Fill in the placeholders first.
Audit a pandas analysis for silent errors. The code for merges and groupby operations: [CODE]. Row counts and totals before and after each step if I have them: [ROW_COUNTS_AND_TOTALS]. What the final figures should reconcile to: [RECONCILIATION_TARGET]. Review each merge for key uniqueness (one-to-one, many-to-one, many-to-many), the join type, the effect on row counts, unmatched keys, duplicate columns with suffixes, and the data type of the keys. Review each groupby for the aggregation function, handling of missing values, the effect of grouping keys that contain nulls, and double counting after a join. Create a table with Step, Risk, Check (what to print or assert), and Expected result. Write the checks as short pandas snippets I can paste (for example comparing len before and after, using validate arguments in merge [VERIFY for my version]). Show a worked example with two small tables where a many-to-many join doubles a sum, and the check that catches it. Do not run the code. Describe expected outputs.
Fill in before use
Optional: type your details and the prompt above updates. Nothing is saved or sent.
Replace each bracketed placeholder with your own details, then paste into ChatGPT, Claude, Gemini or another assistant.