AI Prompts for Claude for Data Analysis

20 tested prompts across 4 stages. Works with ChatGPT, Claude, and Gemini.

AI Prompts for Claude for Data Analysis
Scroll to explore

Getting Claude for Data Analysis right takes more than a single prompt. This 4-stage guide covers Plan and Prepare the Analysis, Write and Debug Analysis Code, Interpret and Validate Results, and more, breaking the whole process into focused steps where each prompt builds on the last. Data analysts spend hours on the wrong things: cleaning messy data, writing boilerplate code, and translating findings into language that non-technical stakeholders understand. These prompts use Claude to accelerate exploratory analysis, generate and debug analysis code, interpret statistical results accurately, and turn data insights into clear narratives that drive decisions. Every prompt is tested and runs in ChatGPT, Claude, and Gemini.

Stage 1

Plan and Prepare the Analysis

Good analysis starts with a clear question, not a spreadsheet. These prompts help you scope the analysis, identify the right approach, and prepare your data before touching the numbers.

Define the analysis question and metric

I need to analyze [DESCRIBE DATASET OR SITUATION] to help [BUSINESS DECISION OR STAKEHOLDER QUESTION]. Help me sharpen the analysis question. What exactly am I trying to measure? What metric best captures it? What would "success" look like in the data, and what would "failure" look like? Also flag any ways my question could be answered superficially without actually solving the underlying business problem.

Plan and Prepare the Analysis

Design the analysis approach

My analysis question is: [QUESTION]. My data includes: [DESCRIBE COLUMNS AND DATA TYPES]. Suggest an appropriate analysis approach. What type of analysis fits this question: descriptive, diagnostic, predictive, or prescriptive? What statistical methods or visualizations would best answer it? What are the most important assumptions I should check first?

Plan and Prepare the Analysis

Identify data quality issues

Here is a sample of my dataset (first 20 rows): [PASTE DATA SAMPLE]. And here is a description of what each column represents: [DESCRIBE COLUMNS]. Identify any data quality issues I should address before analyzing: missing values, outliers, inconsistent formatting, likely data entry errors, or columns that may not mean what I think they mean. Suggest how to handle each issue.

Plan and Prepare the Analysis

Write data cleaning steps

My data has these quality issues: [DESCRIBE ISSUES — MISSING VALUES IN X COLUMN, INCONSISTENT DATE FORMATS, OUTLIERS IN Y COLUMN]. I am using [PYTHON/SQL/EXCEL/R]. Write the data cleaning steps I should perform, in order, with code for each step. Explain the reasoning behind each step so I understand what I am doing and can adapt it if my data differs slightly.

Plan and Prepare the Analysis

Choose between analysis tools

I need to analyze [DESCRIBE DATASET AND QUESTION]. I have access to [TOOLS YOU HAVE — PYTHON, SQL, EXCEL, R, TABLEAU, LOOKER]. Which tool is best for this specific analysis? Consider: data size, type of analysis, whether I need to share results, and whether I will need to repeat this analysis regularly. Give me a recommendation with reasoning.

Plan and Prepare the Analysis

Stage 2

Write and Debug Analysis Code

Code that works is better than perfect code. These prompts help you write analysis scripts quickly, debug errors without losing hours, and document code so others can use it.

Write an exploratory data analysis script

I have a dataset with the following columns: [LIST COLUMNS AND DATA TYPES]. I am using [PYTHON WITH PANDAS / R]. Write a complete exploratory data analysis script that: summarizes each column (data type, missing values, unique values, distribution), identifies correlations between key variables, and produces three to five visualizations that would give me a rapid overview of the dataset. Include comments explaining each step.

Write and Debug Analysis Code

Write a SQL query for a business question

I have a database with these tables and relationships: [DESCRIBE SCHEMA]. My business question is: [QUESTION]. Write the SQL query that answers it. If the question requires joins, aggregations, window functions, or subqueries, include those and explain what each part is doing. Also flag any assumptions I need to verify about the data (e.g., that IDs are unique, that dates are consistently formatted).

Write and Debug Analysis Code

Debug an analysis error

I am running this code: [PASTE CODE]. It produces this error: [PASTE ERROR MESSAGE]. I am using [PYTHON / R / SQL] and [LIBRARY/DATABASE IF RELEVANT]. Diagnose what is causing the error and show me the corrected code. Explain what the bug was so I understand it, not just so I can copy the fix.

Write and Debug Analysis Code

Optimize a slow query or script

This query or script is running too slowly: [PASTE CODE]. My dataset has approximately [NUMBER] rows and [NUMBER] columns. The query is taking [X] seconds / minutes. Identify the likely bottleneck and rewrite the code to run faster. Explain the optimization technique used so I can apply it to similar situations.

Write and Debug Analysis Code

Build a reusable analysis function

I find myself running this analysis repeatedly with slightly different parameters: [DESCRIBE WHAT YOU DO EACH TIME]. Write a reusable Python function (or SQL stored procedure) that accepts the varying parameters as arguments, runs the analysis, and returns a clean result I can use downstream. Include input validation and a docstring.

Write and Debug Analysis Code

Stage 3

Interpret and Validate Results

Numbers do not interpret themselves. These prompts help you draw the right conclusions from your analysis, avoid common mistakes, and pressure-test your findings.

Interpret a statistical result

I ran a [DESCRIBE STATISTICAL TEST — T-TEST / REGRESSION / CORRELATION / ANOVA / CHI-SQUARE] and got the following result: [PASTE RESULT]. My sample size is [N]. Interpret this result in plain English. Is it statistically significant? Is the effect size meaningful, or is this a significant result that is too small to matter in practice? What are the main limitations on what I can conclude?

Interpret and Validate Results

Identify alternative explanations for a finding

My analysis shows that [DESCRIBE FINDING — E.G., CUSTOMERS WHO USE FEATURE X HAVE 40% HIGHER RETENTION]. Before I present this as a causal relationship, help me identify at least three alternative explanations that could explain this correlation without X causing higher retention. How could I design a test or collect additional data to rule out the strongest alternative explanations?

Interpret and Validate Results

Check an analysis for common errors

Here is my analysis methodology and findings: [DESCRIBE WHAT YOU DID AND WHAT YOU FOUND]. Check for these common analysis errors: survivorship bias, Simpson's paradox, p-hacking or multiple comparisons problem, confounding variables, selection bias, and overfitting. Flag any that may apply to my analysis and explain how I should address them.

Interpret and Validate Results

Validate a segmentation or cohort analysis

I segmented my data into groups based on [SEGMENTATION CRITERIA] and found the following differences between groups: [DESCRIBE FINDINGS]. Help me validate whether this segmentation is meaningful. Are the groups large enough? Are the differences statistically significant? Is the segmentation criteria likely to reflect a real underlying difference in behavior, or could it be an artifact of how the data was collected?

Interpret and Validate Results

Stress-test a key business metric

We use [METRIC NAME] as a key performance indicator, and it currently shows [VALUE]. But I want to stress-test whether this metric is actually measuring what we think it measures. Help me examine: What behaviors or events cause this metric to go up? What could make the metric look good while the underlying reality is getting worse? What data would I need to confirm this metric is a reliable signal of [BUSINESS GOAL]?

Interpret and Validate Results

Stage 4

Communicate Findings to Stakeholders

Analysis that is not communicated clearly has no impact. These prompts help you translate technical findings into stories that drive action.

Write an executive summary of findings

My analysis shows the following: [DESCRIBE KEY FINDINGS]. My audience is [DESCRIBE STAKEHOLDERS — EXECUTIVES / PRODUCT TEAM / MARKETING / BOARD]. Write a one-page executive summary that: states the business question we were answering, summarizes the key finding in one sentence, provides the three most important supporting data points, and ends with a clear recommendation or decision that should follow from this analysis.

Communicate Findings to Stakeholders

Explain a complex finding simply

I need to explain this technical finding to a non-technical audience: [DESCRIBE FINDING]. Write an explanation that uses an analogy, avoids jargon, and focuses on what this means for the business — not how we calculated it. The explanation should be at most three sentences and should answer the implicit question: "So what does this mean for us?"

Communicate Findings to Stakeholders

Build a data story structure

I have these analysis findings: [LIST KEY FINDINGS]. I need to present them to [AUDIENCE] in [FORMAT — SLIDE DECK / WRITTEN REPORT / FIVE-MINUTE TALK]. Help me build the narrative structure. What is the setup (context and question)? What is the complication (why this matters now)? What is the resolution (what the data shows)? What is the call to action? Outline the presentation in this structure.

Communicate Findings to Stakeholders

Suggest the right chart for each finding

I have these findings to visualize: [LIST EACH FINDING]. For each one, recommend the most effective chart type (bar, line, scatter, heatmap, funnel, etc.) and explain why that chart type best communicates this specific insight. If there is a common mistake people make when visualizing this type of data, mention it so I can avoid it.

Communicate Findings to Stakeholders

Anticipate stakeholder questions

I am about to present these findings: [DESCRIBE FINDINGS]. My audience includes [DESCRIBE STAKEHOLDERS AND THEIR TYPICAL CONCERNS]. Generate the top seven questions they are likely to ask — including skeptical questions that challenge the methodology or the conclusions. For each question, draft a concise, honest answer that I can prepare in advance.

Communicate Findings to Stakeholders

Frequently asked questions

Can Claude write Python or SQL for data analysis?+

Yes. Claude can write pandas, NumPy, matplotlib, and scikit-learn code in Python, as well as complex SQL including window functions, CTEs, and aggregations. It can also debug errors and explain what the code is doing.

Is Claude good at statistics?+

Claude is strong at explaining statistical concepts, interpreting results, and helping you choose the right test for your data. For complex or novel statistical questions, verify its reasoning against a reference. It can make mistakes on nuanced statistical edge cases.

How do I share data with Claude for analysis?+

Paste a sample of your data (20-50 rows) directly into the prompt. For larger datasets, describe the schema (column names, data types, row count) and paste a representative sample. Claude cannot access external files or databases directly.

What data analysis tasks is Claude best at?+

Claude excels at writing and debugging analysis code, explaining statistical results in plain language, designing analysis approaches, identifying biases or alternative explanations, and turning findings into clear written narratives for stakeholders.

Can Claude replace a data analyst?+

No. Claude is a force multiplier for analysts, not a replacement. It is strongest at the tedious tasks — writing boilerplate code, explaining results, structuring reports — that take time away from the harder analytical judgment that humans do better.