When to use it

Use this prompt when you have a dataset and a question but are not sure how to structure the analysis, or when you want working pandas code without writing every groupby yourself. It suits analysts, product managers, researchers and students who know some Python. It also works as a review tool: paste your own plan and ask what is missing.

How to customize it

  • [BUSINESS QUESTION] can be informal; step 1 turns it into precise definitions you can approve or correct.
  • [DATASET] size matters: a few thousand rows and tens of millions of rows call for different approaches.
  • [COLUMNS] should include types and meaning. “amount (float, EUR, includes VAT)” prevents wrong assumptions.
  • [SAMPLE ROWS] show the real format of dates, IDs and categories. Use fake or anonymized rows.
  • [KNOWN DATA ISSUES] saves the model from discovering problems the hard way, or not at all.
  • [ENVIRONMENT] keeps the code compatible with your library versions.

Why it works

Analysis goes wrong most often at the definition stage, not in the code. Asking for metrics and definitions first makes the model commit to an interpretation you can check. A step-by-step plan keeps the code modular, so you can run and inspect each stage instead of trusting one long script.

The built-in data quality checks catch duplicates, missing values and odd date ranges before they distort results. The section on what the result cannot show protects against the most common overreach: reading a correlation as a cause. If you use a chat tool that runs code, our explainer on how AI data analysis tools work describes what happens behind the scenes.

Tips and variations

  • Run the code step by step and paste unexpected output back for an explanation.
  • Do not upload personal or confidential data to tools your organization has not approved; the schema and fake rows are usually enough.
  • Ask for the same plan in SQL or polars if that is where your data lives.
  • Add “Produce one chart per finding with a title that states the conclusion” for presentation-ready output.
  • Save the final notebook with the definitions at the top so others can reproduce the numbers.