A model is genuinely useful for data work in two ways: writing code you then run, and interrogating an analysis you have already done. It is least reliable at the thing people trust it with most, which is telling you what a result means.

The twenty prompts below run across six stages, from auditing a raw dataset through to critiquing your own finished analysis. Each has a note explaining why it works, and every one of them expects you to paste real structure or real data rather than describe it vaguely.

They work in ChatGPT and any comparable model. When the problem behind the data is not yet clear, our ChatGPT prompts for problem solving come first, and for prompting technique generally see the main ChatGPT prompts guide.

chat smith pro

What a Model Cannot Do With Your Data

  • It cannot see data you have not pasted. Every prompt below asks for a sample or a schema for exactly this reason. Describe a dataset in three lines and you will get plausible analysis of a dataset that does not exist.
  • Generated code must be run, not trusted. SQL and Python can be syntactically perfect and semantically wrong: a join that silently multiplies rows, a groupby that drops nulls, a fillna that distorts the distribution you were about to measure. Check row counts before and after every transformation.
  • It cannot know how many things you looked at. This is the most important limitation on the page. Show a model one significant result and it will explain the p-value fluently. It has no way of knowing you tested twenty metrics and are reporting the one that came in under 0.05. Tell it how many comparisons you made, or the interpretation is worthless.
  • Correlation stays correlation. A model will produce a confident causal-sounding narrative from a correlation matrix if you let it. Prompt 6 is written to prevent that, and it is worth keeping the plain-language clause when you adapt it.
  • Use prompt 20 before you present anything. Having your own analysis attacked by a critical reviewer is the single highest-value use of a model in this whole workflow, and it is the one people skip because the analysis already feels finished.

Stage 1: Understanding and Cleaning Your Data

Four prompts for the stage that determines whether everything after it is meaningful. All four expect a pasted sample rather than a description.

Prompt 1: Initial Data Audit

I have a dataset with the following columns and sample rows: [paste sample]. Act as a senior data analyst. Audit this dataset and tell me: (1) what each column likely represents, (2) which columns have data quality issues such as nulls, inconsistencies, or likely errors, (3) what questions this data can and cannot reliably answer, and (4) what cleaning steps I should take before analysis.

Why it works: this prompt treats the AI as a collaborator reviewing your raw data rather than a tool executing a specific task. The four-part structure forces a comprehensive audit rather than a surface-level scan.

Prompt 2: Data Cleaning Code

Write Python (pandas) code to clean this dataset: [paste sample or describe structure]. The cleaning should: (1) handle missing values in [column names] using [strategy: drop / fill with median / fill with mode / forward fill], (2) standardise inconsistent values in [column] - for example [list known inconsistencies], (3) convert [column] to the correct data type, and (4) remove duplicate rows based on [key columns]. Add a comment explaining each cleaning step.

Why it works: specifying the cleaning strategy for each column prevents the AI from making assumptions that could distort your data. The request for comments makes the output auditable. Print the row count after each step so a silent drop does not go unnoticed.

Prompt 3: Outlier Detection

I have a dataset with numerical columns [list columns]. Write Python code to: (1) detect outliers in each column using both the IQR method and Z-score method, (2) print a summary showing how many outliers each method flags in each column, and (3) explain the difference between the two methods and when I should use each one. My dataset has [number] rows and represents [describe what the data is].

Why it works: using two methods and asking for a comparison gives you a more informed decision about whether flagged values are genuine outliers or legitimate data points, which depends heavily on your domain.

Prompt 4: Feature Engineering

I am analysing a dataset about [describe subject: e.g. customer transactions, website sessions, employee records]. My columns are: [list columns]. Suggest 5 to 8 new features I could engineer from the existing columns that would be useful for [describe your goal: e.g. predicting churn, understanding seasonal patterns, segmenting customers]. For each feature, explain what it captures and write the pandas code to create it.

Why it works: feature engineering suggestions grounded in a specific goal and dataset are far more actionable than generic advice. The code alongside each suggestion lets you immediately test whether the feature adds value.

Never accept a cleaning step without checking what it removed. The most expensive errors in data work are silent ones, and a fillna applied to the wrong column produces a result that looks entirely normal.

Stage 2: Exploratory Data Analysis

Four prompts for finding out what is in the data. Anchor every one of them to a business question, because unanchored exploration produces output rather than answers.

Prompt 5: EDA Plan

I am starting exploratory data analysis on a dataset about [describe subject]. My business question is: [state your question]. The dataset has these columns: [list columns with types]. Write a structured EDA plan that covers: (1) univariate analysis for key columns, (2) bivariate analysis for relationships most relevant to my business question, (3) the visualisations I should create and why, and (4) the hypotheses I should test. Then write the Python code to execute the plan.

Why it works: anchoring EDA to a specific business question focuses the analysis. Without this anchor, exploratory analysis can become a fishing expedition that generates outputs without answering anything useful.

Prompt 6: Correlation Analysis

My dataset has these numerical columns: [list columns]. My target variable is [column name]. Write Python code to: (1) compute a correlation matrix, (2) identify the top 5 features most correlated with the target, (3) create a heatmap using seaborn, and (4) explain what the correlation values mean in plain language, including what high correlation does and does not tell me about causation.

Why it works: requesting the plain-language explanation alongside the code prevents the common mistake of treating correlation as causation, and makes the output immediately presentable to non-technical stakeholders.

Prompt 7: Segmentation and Grouping

I want to understand how [metric: e.g. revenue, engagement, churn rate] varies across different segments of my data. My dataset has these grouping variables: [list categorical columns]. Write Python code to: (1) calculate [metric] by each grouping variable individually, (2) calculate [metric] by the most interesting two-way combinations, (3) flag any segments that are significantly above or below average, and (4) produce a clear summary table of findings.

Why it works: segmentation is where most actionable insights live. Asking the AI to flag statistically notable segments rather than just producing tables means you get analysis, not just data aggregation. Note that testing many segments at once raises the chance of a false positive, so treat a single standout segment as a hypothesis rather than a finding.

Prompt 8: Time Series Exploration

I have time series data with a date column [column name] and a metric column [column name]. The data covers [date range] and represents [describe what the metric is]. Write Python code to: (1) resample the data at daily, weekly, and monthly levels, (2) plot the trend for each level, (3) calculate and plot a 7-day and 30-day rolling average, (4) identify the top 5 peaks and troughs and label them on the chart, and (5) describe what patterns are visible and what might explain them.

Why it works: looking at multiple time granularities simultaneously reveals patterns that a single-level view misses. Asking for labelled peaks and troughs turns the chart into a starting point for root cause analysis.

Write the business question down before you start and keep it visible. Exploratory analysis without an anchor is how a week disappears into charts nobody asked for.

Stage 3: SQL Query Generation

Three prompts for queries. This is where a model is at its most useful, because the output is code you can verify by running it. Always name your dialect, and always check the row count against something you already know.

Prompt 9: Complex Aggregation Query

I am working with a SQL database. My schema is: [describe tables and key columns, or paste CREATE TABLE statements]. Write a SQL query to [describe what you want to calculate: e.g. calculate monthly revenue by product category, with month-over-month growth rate and a 3-month rolling average]. Use [SQL dialect: PostgreSQL / BigQuery / MySQL / Snowflake]. Add comments explaining each section of the query and flag any assumptions you have made about the schema.

Why it works: specifying the SQL dialect matters, because window function syntax and date functions vary significantly across databases. Requesting flagged assumptions means you can catch schema mismatches before running the query.

Prompt 10: Cohort Analysis Query

Write a SQL cohort analysis query using my tables: [describe schema]. I want to: (1) group users by the month they first [performed action: e.g. made a purchase, signed up], (2) track what percentage of each cohort returned in months 1, 2, 3, 6, and 12 after their first action, and (3) output a cohort retention grid I can export to a spreadsheet. Use [SQL dialect]. Explain how cohort analysis works and what I should look for in the results.

Why it works: cohort queries are notoriously difficult to write from scratch. Getting working code alongside an explanation of what to look for means you can interpret results correctly even if you are new to cohort analysis.

Prompt 11: Query Optimisation

I have this SQL query that is running slowly: [paste query]. My database is [SQL dialect] and the tables involved have approximately [row counts]. Review the query and: (1) identify what is likely causing the performance issue, (2) rewrite it to be more efficient, (3) suggest any indexes that would speed up this type of query, and (4) explain the changes you made and why they improve performance.

Why it works: query optimisation requires understanding both the logic and the execution plan. Asking for explanations alongside the fix helps you build the knowledge to write better queries yourself rather than just fixing this one.

Run the rewritten query alongside the original and compare the output before you trust the faster one. A query that returns the wrong answer quickly is not an optimisation.

Stage 4: Statistical Analysis and Interpretation

Three prompts, and the stage that needs the most care. A model will explain a statistical result fluently whether or not the result means anything, so tell it how many comparisons you made and how the test was designed before you ask what the number means.

Prompt 12: Hypothesis Testing

I want to test whether [describe hypothesis: e.g. customers who received the discount have higher average order value than those who did not]. My dataset has [describe relevant columns and sample sizes]. Recommend the appropriate statistical test for this hypothesis, explain why it is the right choice, write Python code to run the test, and interpret the results in plain language including what the p-value means for my business decision.

Why it works: most analysts know they need a statistical test but are unsure which one to apply. Asking the AI to justify its recommendation builds your statistical intuition alongside delivering the answer. Add how many hypotheses you are testing in total, or the p-value will be interpreted as though this were the only one.

Prompt 13: A/B Test Analysis

I ran an A/B test with the following setup: control group size [n], treatment group size [n], control conversion rate [%], treatment conversion rate [%], test duration [days]. Analyse this A/B test and tell me: (1) whether the result is statistically significant and at what confidence level, (2) the practical significance - is the effect size large enough to matter for my business, (3) whether there are any concerns about the test design that might invalidate the result, and (4) what I should do next.

Why it works: statistical significance and practical significance are different things. Many A/B test analyses focus only on the p-value and miss the question of whether the effect is actually large enough to justify the cost of the change. Part 3 is the part to read carefully, and it is worth also stating whether you stopped the test early or checked it while it was running.

Prompt 14: Regression Analysis

I want to understand what drives [target variable] in my dataset. My features are: [list columns]. Write Python code to: (1) run a linear regression with [target] as the dependent variable and [feature list] as independent variables, (2) check the key regression assumptions (linearity, homoscedasticity, normality of residuals, multicollinearity), (3) interpret the coefficients in plain language, and (4) identify which features have the most predictive power and flag any that should be removed.

Why it works: regression without assumption checking produces unreliable results. Building the assumption tests into the prompt ensures you get a valid model rather than just a model. Read the coefficient interpretation as association, not effect, unless your data came from an experiment.

Tell it what you did, not just what you found. Whether you stopped a test early, how many metrics you checked, and whether the data came from an experiment all change what the number means, and none of it is visible in the number itself.

Stage 5: Visualisation and Reporting

Three prompts for the stage where analysis either lands or does not. Naming your audience changes the output more than any other variable here.

Prompt 15: Chart Selection and Code

I want to visualise [describe what you want to show: e.g. the distribution of customer ages by product category, the trend in weekly revenue over the past year, the relationship between marketing spend and conversions]. My dataset has these relevant columns: [list]. Recommend the best chart type for each visualisation and explain why. Then write Python code using matplotlib and seaborn to create each chart with proper titles, axis labels, and a colour scheme that works for business presentations.

Why it works: chart type selection is a genuinely difficult decision that most people default on. Asking for justification alongside code means you understand why a particular chart works, which helps you make better choices independently.

Prompt 16: Dashboard Design Plan

I am building a data dashboard for [describe audience: e.g. the sales leadership team, the marketing team, the board]. Their primary question is: [state the question]. My available data covers: [describe datasets and key metrics]. Design a dashboard structure that includes: (1) the 3 to 5 most important KPIs to show at the top, (2) the supporting charts and breakdowns, (3) the filters and controls users will need, and (4) the layout and visual hierarchy. Explain why each element earns its place on the dashboard.

Why it works: most dashboards fail because they show everything instead of answering a specific question. Forcing the design to start from the audience's primary question produces dashboards that actually get used.

Prompt 17: Insight Narrative

I have completed an analysis of [describe subject] and found the following key results: [paste your findings or summary statistics]. Write an executive summary of these findings for [describe audience: e.g. the CFO, the product team, the board]. The summary should: (1) open with the most important finding, (2) explain what it means for the business in plain language, (3) highlight 2 to 3 supporting findings, (4) identify the key uncertainty or caveat in the analysis, and (5) close with a clear recommendation. Keep it under 300 words.

Why it works: translating analytical findings into business language is one of the hardest parts of the analyst role. Structuring the narrative to open with the most important finding, not the methodology, mirrors how executives actually want to consume information.

Keep part 4 of prompt 17 in every summary you write. An analysis presented without its main caveat will eventually be quoted back to you without it too.

Stage 6: Advanced and Specialist Analysis

The last three. Prompt 20 is the one the original version of this page called the most valuable on the list, and that assessment is correct.

Prompt 18: Customer Segmentation

I want to segment my customers based on their behaviour. My dataset has these customer-level features: [list features, e.g. total spend, purchase frequency, days since last purchase, product categories purchased]. Write Python code to: (1) normalise the features, (2) use K-means clustering to segment customers into 3 to 6 groups, (3) determine the optimal number of clusters using the elbow method, (4) profile each segment - what makes them distinct - and (5) suggest a name and a business action for each segment.

Why it works: segmentation is only useful if it leads to action. Asking for a name and business action for each segment forces the analysis to produce something operationally useful, not just a statistical artefact.

Prompt 19: Anomaly Detection

I need to detect anomalies in my [describe data: e.g. daily transaction volume, server response times, weekly sales figures]. My dataset has [describe structure and time range]. Write Python code to: (1) apply Isolation Forest to detect anomalies, (2) visualise the results showing normal and anomalous points, (3) print a table of the top 10 most anomalous records with their key values, and (4) explain what kinds of anomalies this method is good at detecting and what it might miss.

Why it works: anomaly detection can surface fraud, system errors, or unexpected business events. Asking about what the method might miss is important, because Isolation Forest has known limitations that matter depending on your use case.

Prompt 20: Analysis Review and Critique

I have conducted the following analysis: [describe or paste your analysis, methodology, and findings]. Act as a critical peer reviewer. Identify: (1) any methodological weaknesses or invalid assumptions, (2) alternative explanations for the findings I may have overlooked, (3) confounding variables I should have controlled for, (4) whether my conclusions are supported by the evidence or overstate it, and (5) what additional analysis would strengthen or challenge my conclusions.

Why it works: this is the most valuable prompt on the list. Using AI to stress-test your own analysis before presenting it is like having a senior analyst review your work. It catches errors that confirmation bias would cause you to miss.

Run prompt 20 while there is still time to act on the answer. A critique that arrives after the deck has been sent is a lesson rather than a review.

Using These Data Analysis Prompts in Chat Smith

Paste real structure rather than describing it. A schema, ten sample rows, actual column names and actual row counts change the output completely, and nothing on this page works well without them. Redact or rename anything sensitive first - the prompts do not depend on real customer names or real company identifiers.

For the statistical prompts, Claude Sonnet 5 tends to be more willing to say a result does not support a conclusion rather than finding a way to make it work, which is what prompt 20 needs. GPT-5.2 is quicker on the code generation. Running the same query prompt through both and comparing the output is a cheap way to catch a logic error before it reaches a dashboard.

Related sets worth knowing: our ChatGPT prompts for SEO cover reporting on search data specifically, the best ChatGPT prompts collection includes shorter general-purpose versions of the anomaly and confidence checks, and the same six-stage structure applied to studying is in our ChatGPT prompts for learning maths. Chat Smith is free to try.

And the habit that matters most: run the code, check the row counts, and tell the model what you did before asking what it means. Every serious error in AI-assisted analysis comes from skipping one of those three.

Frequently Asked Questions

ChatGPT prompts for data analysis are instructions that ask an AI model to work through a dataset task: cleaning rules, a formula, a query, code for a chart, or an interpretation of results you already have. The useful ones describe your columns and your question rather than asking for general advice.

logo chat smith

Editorial Team

Managing Editor

The Chat Smith Editorial Team is a group of AI enthusiasts, researchers, and content creators passionate about making artificial intelligence more accessible and practical. Through the Chat Smith blog, we share the latest AI trends, tool reviews, industry insights, and actionable guides to help individuals and businesses get more value from AI. Our mission is simple: deliver clear, reliable, and easy-to-understand content that helps readers stay informed, productive, and ahead in the fast-moving world of AI.

Share this article

Related Articles

Level Up Your Work, One Click Away!

Everything you need to push projects forward is right at your fingertips.