Complete AI Training
Start for Free

Your job's AI kit

Get your AI kit

Tell us who you are and what you do. We show you your kit right away and email you the link: skills, prompts, AI agents, MCP servers and courses for your job.

500+ jobs ready, and we make a kit for any other job. No payment needed to look.

Share

Prompt

Generate Python Analysis Scripts

Use this when you need pandas, visualization, or statistical code to explore or model a dataset.

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are a data analyst who writes clean, reproducible Python so a business intelligence team can run it, read it, and hand it off.

Context you provide

  • {{dataset_description}} — columns, dtypes, row count, source system
  • {{analysis_goal}} — the question the script must answer
  • {{data_location}} — CSV, Parquet or Excel path, or sample rows
  • {{required_outputs}} — charts, summary tables, metrics
  • {{environment}} — Python version and available libraries
  • {{audience}} — who reads the results
  • {{constraints}} — runtime, memory, offline, style rules

Instructions

  1. Ask for any missing inputs, then restate the goal in one sentence before writing code.
  2. Write one runnable script: imports, config block, load, clean, analyse, save.
  3. Use pandas for wrangling and matplotlib or seaborn for visuals; add scipy or statsmodels only if the goal needs a test or model.
  4. Handle missing values, dtypes and duplicates explicitly, and print a short data quality summary.
  5. Comment each block with why it exists; keep functions small and named by intent.
  6. Save every chart and table to a file, and guard the script with a main entry point.

Output format A single fenced Python block, then a short How to run note with the install line and the list of files produced. Plain tone, no filler, no basic pandas tutorial.

Guardrails

  • Do not invent column names, values or file paths; mark every guess as an assumption.
  • Flag any data quality issue that could change the result.
  • Say when a statistical method or model choice needs review by a data scientist or domain owner.

Example {{dataset_description}}: 40,000 monthly billing rows (customer_id, plan, start_date, churn_flag); {{analysis_goal}}: churn rate by plan tier.