Home »
AI Prompts Tutorial
AI Prompts for Data Analysis
AI can help data analysts work with datasets, identify patterns, clean information, calculate statistics, create summaries, generate queries, and communicate findings. Well-designed prompts can provide the AI model with clear information about the data, the analytical objective, and the expected output.
In this chapter, you will learn 41 practical AI prompts for data analysis. These prompts cover common tasks such as data cleaning, exploratory analysis, statistical analysis, visualization, SQL queries, trend analysis, forecasting, and reporting.
1. Understand a Dataset
Before analyzing a dataset, it is useful to understand its structure, columns, data types, and general purpose. AI can provide an initial overview and identify important fields that may require attention.
Example
Analyze the following dataset and provide an overview.
Identify:
- Number of rows and columns
- Column names
- Data types
- Possible identifiers
- Numerical columns
- Categorical columns
- Date columns
- Potentially important fields
[Paste dataset or sample data here]
2. Clean a Dataset
Data cleaning is an important step before performing analysis. AI can help identify missing values, inconsistent formats, duplicate records, and other potential quality issues.
Example
Review the following dataset for data quality issues.
Check for:
- Missing values
- Duplicate records
- Inconsistent values
- Incorrect data types
- Invalid dates
- Formatting problems
- Unusual values
Explain each issue and suggest a suitable cleaning approach.
[Paste dataset here]
3. Find Missing Values
Missing data can affect calculations and statistical analysis. AI can help identify which columns contain missing values and suggest appropriate approaches for handling them.
Example
Analyze the following dataset for missing values.
For each column provide:
- Number of missing values
- Percentage of missing values
- Possible reason for missing data
- Recommended handling approach
[Paste dataset here]
4. Detect Duplicate Records
Duplicate records can cause incorrect counts and distorted analysis results. AI can help identify possible duplicate entries and suggest rules for determining which records should be retained.
Example
Check the following dataset for duplicate records.
Identify:
- Exact duplicates
- Possible duplicates
- Columns that can be used to identify duplicates
Suggest a safe approach for removing or reviewing duplicates.
[Paste dataset here]
5. Identify Outliers
Outliers are observations that differ significantly from other values in a dataset. AI can help identify potential outliers and explain whether they may represent errors, unusual events, or legitimate observations.
Example
Analyze the following sales data and identify potential outliers.
For each outlier provide:
- Value
- Relevant column
- Why it appears unusual
- Possible explanation
- Recommended action
Do not automatically remove any observation.
[Paste dataset here]
6. Summarize Numerical Data
Descriptive statistics provide a quick understanding of numerical variables. AI can help calculate and explain measures such as minimum, maximum, mean, median, and standard deviation.
Example
Calculate descriptive statistics for the following dataset.
For each numerical column provide:
- Minimum
- Maximum
- Mean
- Median
- Standard deviation
- Count
Explain the most important observations.
[Paste dataset here]
7. Analyze Categorical Data
Categorical variables represent groups or labels such as product types, regions, departments, or customer segments. AI can summarize category frequencies and identify dominant or less common groups.
Example
Analyze the categorical columns in the following dataset.
For each categorical column:
- List the unique categories
- Count each category
- Calculate the percentage of each category
- Identify the most common category
[Paste dataset here]
8. Find the Average
Average values can provide a simple summary of numerical data. AI can calculate the average and explain what the result means in the context of the dataset.
Example
Calculate the average monthly revenue from the following data.
January: 12000
February: 15000
March: 18000
April: 14000
Show the calculation and provide the final result.
9. Calculate Median and Mode
The median and mode can provide additional information when analyzing a dataset. The median represents the middle value, while the mode identifies the most frequently occurring value.
Example
Calculate the mean, median, and mode for the following values:
10, 15, 15, 20, 25, 30, 30, 30, 40
Explain what each result tells us about the dataset.
10. Calculate Percentages
Percentages are commonly used to compare categories, calculate proportions, and understand changes in data. AI can perform these calculations and present the results in a structured format.
Example
A company has 500 employees.
320 work remotely and 180 work from the office.
Calculate:
- Percentage of remote employees
- Percentage of office-based employees
Show the calculations and verify that the percentages add up to 100%.
11. Analyze Trends
Trend analysis helps identify whether a value is increasing, decreasing, or remaining relatively stable over time. AI can review time-based data and summarize the major patterns.
Example
Analyze the following monthly revenue data.
January: $10,000
February: $12,000
March: $11,000
April: $15,000
May: $18,000
Identify:
- Overall trend
- Highest month
- Lowest month
- Significant changes
- Possible observations
[Paste data here]
12. Compare Two Periods
Comparing two time periods can reveal changes in sales, traffic, revenue, customers, or other business metrics. AI can calculate the absolute and percentage differences between the periods.
Example
Compare the following monthly performance data.
Previous Month:
Revenue: $50,000
Orders: 1,000
Customers: 800
Current Month:
Revenue: $60,000
Orders: 1,200
Customers: 900
Calculate:
- Absolute change
- Percentage change
- Key observations
13. Analyze Growth Rate
Growth rate helps measure how quickly a metric changes between periods. It is commonly used for revenue, users, sales, website traffic, and other business measurements.
Example
Calculate the month-over-month growth rate for the following revenue:
January: $20,000
February: $24,000
March: $30,000
April: $27,000
Show the calculation for each month and summarize the trend.
14. Analyze Correlation
Correlation analysis can help identify whether two variables tend to move together. A correlation does not by itself prove that one variable causes another, so the results should be interpreted carefully.
Example
Analyze the relationship between advertising spend and sales.
Advertising Spend:
[Data]
Sales:
[Data]
Calculate the correlation and explain:
- Direction of the relationship
- Strength of the relationship
- What the result may indicate
- Why correlation does not necessarily imply causation
15. Identify Top-Performing Products
Product-level analysis can help businesses understand which products generate the most sales or revenue. AI can rank products and summarize their performance.
Example
Analyze the following product sales data.
Identify the top five products by revenue.
For each product provide:
- Product name
- Units sold
- Revenue
- Percentage of total revenue
Sort the results from highest to lowest revenue.
[Paste dataset here]
16. Analyze Customer Segments
Customer segmentation can reveal differences between groups based on characteristics such as age, location, spending, or engagement. AI can summarize each segment and identify important differences.
Example
Analyze the following customer dataset.
Create customer segments based on:
- Purchase frequency
- Total spending
- Recency of purchase
Describe each segment and identify the most valuable segment.
[Paste authorized customer dataset here]
17. Analyze Sales by Region
Regional analysis can help identify geographical differences in business performance. AI can compare revenue, orders, customers, and other metrics across regions.
Example
Analyze sales performance by region.
For each region calculate:
- Total revenue
- Number of orders
- Average order value
- Percentage of total revenue
Rank the regions by revenue and summarize the main findings.
[Paste dataset here]
18. Analyze Customer Churn
Churn analysis examines customers who stop using a product or service. AI can help identify patterns among churned customers and compare them with active customers.
Example
Analyze the following customer churn dataset.
Compare churned and active customers based on:
- Subscription duration
- Monthly spending
- Login frequency
- Support requests
- Product usage
Identify patterns that may be associated with churn.
Do not assume causation from correlation alone.
[Paste dataset here]
19. Calculate Customer Retention
Retention analysis measures how many customers continue using a product or service over time. AI can calculate retention rates and organize the results into cohorts or time periods.
Example
Calculate monthly customer retention from the following data.
January customers: 1,000
February customers retained from January: 850
March customers retained from February: 760
Calculate the retention rate for each period.
Show the calculations and summarize the results.
20. Analyze Conversion Rates
Conversion rate analysis helps determine how effectively users move from one stage of a process to another. It is commonly used in websites, marketing campaigns, sales funnels, and applications.
Example
Analyze the following sales funnel:
Website visitors: 100,000
Product page visitors: 40,000
Added to cart: 8,000
Completed purchases: 2,000
Calculate the conversion rate between each stage.
Identify the stage with the largest drop-off.
21. Analyze Website Traffic
Website traffic data can reveal patterns in visitors, sessions, page views, and traffic sources. AI can summarize performance and identify significant changes across different periods or channels.
Example
Analyze the following website traffic data.
Review:
- Users
- Sessions
- Page views
- Traffic sources
- Conversion rate
Identify the strongest traffic sources and any significant changes.
[Paste website analytics data here]
22. Analyze Marketing Campaign Performance
Marketing campaign analysis helps determine which campaigns generate traffic, engagement, conversions, or revenue. AI can compare campaign metrics and identify the strongest and weakest performers.
Example
Analyze the following marketing campaign data.
For each campaign calculate:
- Click-through rate
- Conversion rate
- Cost per conversion
- Revenue
- Return on advertising spend
Rank the campaigns by overall performance.
[Paste campaign data here]
23. Calculate Return on Investment
Return on investment can help compare the financial performance of different investments or campaigns. AI can calculate ROI from the provided cost and return values.
Example
Calculate the ROI for the following marketing campaign.
Campaign Cost: $5,000
Revenue Generated: $15,000
Show the ROI calculation and explain what the result means.
24. Create a Data Visualization Plan
Choosing the right visualization can make data easier to understand. AI can recommend suitable chart types based on the variables and analytical objective.
Example
Recommend appropriate visualizations for the following dataset.
Data includes:
- Monthly revenue
- Product category
- Region
- Customer count
- Profit
For each metric suggest:
- Chart type
- X-axis
- Y-axis
- Purpose of the visualization
Explain why each chart is appropriate.
25. Generate Python Analysis Code
AI can generate Python code for data analysis using libraries such as pandas and NumPy. Providing the dataset structure and desired analysis helps produce more relevant code.
Example
Write Python code using pandas to analyze a CSV file named sales.csv.
Perform:
1. Load the dataset.
2. Display basic information.
3. Check missing values.
4. Calculate total revenue.
5. Find the top five products by revenue.
6. Save the results to a new CSV file.
Explain the code briefly.
26. Generate SQL for Data Analysis
SQL is widely used to retrieve and analyze data from relational databases. AI can create analytical queries when the table structure, relationships, and desired results are clearly provided.
Example
Write a PostgreSQL query to calculate monthly revenue.
Table:
orders
Columns:
order_id
order_date
customer_id
amount
Return:
- Month
- Total revenue
- Number of orders
Sort the results chronologically.
27. Create a Pivot Table Analysis
Pivot tables are useful for summarizing data across multiple dimensions. AI can help define the fields that should be used for rows, columns, values, and filters.
Example
Create a pivot table analysis for the following sales dataset.
Rows:
Region
Columns:
Product Category
Values:
Total Revenue
Also explain which region and category combination
generates the highest revenue.
[Paste dataset structure here]
28. Analyze Time Series Data
Time series analysis examines data collected over regular time intervals. AI can help identify trends, seasonality, unusual changes, and other patterns in time-based datasets.
Example
Analyze the following monthly website traffic data as a time series.
Identify:
- Overall trend
- Seasonal patterns
- Significant increases
- Significant decreases
- Possible anomalies
Do not make assumptions about causes unless supported by the data.
[Paste time series data here]
29. Detect Anomalies
Anomaly detection can help identify observations that differ significantly from expected patterns. AI can review the data and highlight values that deserve additional investigation.
Example
Analyze the following daily transaction data for unusual patterns.
Identify potential anomalies based on:
- Unusually high transaction values
- Unusually low transaction values
- Sudden changes in transaction volume
- Unusual dates or periods
Explain why each observation may require investigation.
[Paste dataset here]
30. Compare Two Datasets
Comparing datasets can reveal changes between different periods, systems, customer groups, or versions of a dataset. AI can identify common records, missing records, and differences between the datasets.
Example
Compare Dataset A and Dataset B.
Identify:
- Records present in both datasets
- Records only in Dataset A
- Records only in Dataset B
- Changed values
- Duplicate records
Summarize the major differences.
[Paste Dataset A here]
[Paste Dataset B here]
31. Analyze Survey Results
Survey datasets often contain categorical responses, ratings, and open-ended feedback. AI can summarize response distributions and identify common themes in text responses.
Example
Analyze the following customer survey results.
Calculate:
- Response distribution
- Average rating
- Most common responses
- Least common responses
For open-ended responses, identify the five most common themes.
[Paste survey data here]
32. Analyze A/B Test Results
A/B testing compares two versions of a product, webpage, feature, or campaign. AI can help summarize the observed differences and organize the statistical information needed to evaluate the experiment.
Example
Analyze the following A/B test results.
Control:
Visitors: 10,000
Conversions: 500
Variant:
Visitors: 10,000
Conversions: 575
Calculate:
- Conversion rate for each group
- Absolute difference
- Relative improvement
Explain what can and cannot be concluded from these results.
Identify whether a statistical significance test is needed.
33. Create a Statistical Analysis Plan
A statistical analysis plan defines how data will be analyzed before calculations are performed. AI can help organize the research question, variables, statistical methods, and reporting requirements.
Example
Create a statistical analysis plan for a study examining
whether study time is associated with exam scores.
Include:
- Research question
- Dependent variable
- Independent variable
- Descriptive statistics
- Suitable statistical test
- Visualization
- Interpretation approach
Explain why each analysis method is appropriate.
34. Analyze Distribution of Data
Understanding the distribution of a numerical variable can help determine which statistical methods and visualizations are appropriate. AI can summarize skewness, concentration, spread, and potential unusual values.
Example
Analyze the distribution of the following customer purchase values.
Identify:
- Minimum
- Maximum
- Mean
- Median
- Spread
- Potential skewness
- Potential outliers
Suggest suitable visualizations for understanding the distribution.
[Paste data here]
35. Analyze Product Performance
Product performance analysis can combine sales, revenue, customer ratings, and other metrics. AI can help compare products and identify those performing particularly well or poorly.
Example
Analyze the following product performance data.
For each product evaluate:
- Units sold
- Revenue
- Profit
- Customer rating
- Return rate
Rank the products and identify the strongest and weakest performers.
Explain the main observations.
[Paste dataset here]
36. Analyze Employee Data
Organizations can use data analysis to understand workforce patterns such as department distribution, tenure, absenteeism, and other operational metrics. AI can summarize these patterns while avoiding unsupported conclusions about individual employees.
Example
Analyze the following employee dataset.
Summarize:
- Employees by department
- Average tenure
- Average salary by department
- Employee distribution by location
- Available performance metrics
Identify broad organizational patterns.
Do not make decisions about individual employees based only on this analysis.
[Paste authorized employee dataset here]
37. Generate an Executive Data Summary
Executives often need the most important findings rather than detailed calculations. AI can convert a detailed analysis into a concise summary containing key metrics, trends, findings, and areas that require attention.
Example
Create an executive summary from the following business data.
Include:
- Three key metrics
- Three major trends
- Two important findings
- Two areas requiring attention
- Three recommended questions for further analysis
Use concise business language.
[Paste analysis results here]
38. Create Data Analysis Questions
Before analyzing a dataset, asking the right questions can help define the purpose of the analysis. AI can generate analytical questions based on the available fields and business context.
Example
Generate 20 useful data analysis questions for an online store.
Available data:
- Customers
- Orders
- Products
- Revenue
- Discounts
- Locations
- Dates
Group the questions into:
- Sales
- Customers
- Products
- Marketing
- Operations
39. Find Key Insights
AI can review analysis results and identify observations that may be useful for decision-making. The prompt should ask the model to distinguish data-supported findings from assumptions or possible explanations.
Example
Analyze the following data and identify the five most important insights.
For each insight provide:
- Finding
- Supporting data
- Why it matters
- Possible explanation
- Additional data needed for verification
Do not present assumptions as confirmed facts.
[Paste dataset or analysis results here]
40. Create a Data Analysis Report
A data analysis report brings together the purpose, methodology, findings, and conclusions of an analysis. AI can help organize the report into a consistent structure that is easier for stakeholders to review.
Example
Create a data analysis report based on the following dataset.
Include:
- Objective
- Dataset description
- Data preparation
- Methodology
- Key statistics
- Major findings
- Trends
- Limitations
- Recommendations
- Summary
Clearly distinguish observations from assumptions.
[Paste dataset or analysis results here]
41. Create a Data Analysis Dashboard Plan
A dashboard brings important metrics and visualizations together in one place. AI can help determine which metrics, charts, filters, and comparisons should be included based on the analytical objective.
Example
Create a dashboard plan for an online education business.
Track:
- Website users
- Course enrollments
- Course completion rate
- Revenue
- Conversion rate
- Customer retention
For each dashboard section provide:
- Metric
- Recommended visualization
- Time period
- Filters
- Business question answered
Organize the dashboard into logical sections.
General AI Prompt Template for Data Analysis
A reusable data analysis prompt can help provide the AI model with the context, dataset information, analytical objective, and expected output. This template can be adapted for exploratory analysis, business intelligence, statistical analysis, reporting, and visualization tasks.
Example
Role:
Act as a data analyst.
Objective:
[Describe the purpose of the analysis]
Dataset:
[Describe or paste the dataset]
Context:
[Provide relevant business or research context]
Tasks:
- [Analysis task 1]
- [Analysis task 2]
- [Analysis task 3]
Requirements:
- Use appropriate calculations.
- Clearly identify assumptions.
- Separate findings from interpretations.
- Highlight important patterns and anomalies.
Expected Output:
[Describe the required format]
Additional Instructions:
[Add any specific requirements or constraints]
Advertisement
Advertisement