AI tools, scored for your job
Learn AI in 30 days

📈 Tech & engineering

AI Prompts for Data Science

50 copy-paste AI prompts for data science, pulled from 1 tested Zekai prompt guides. Free, no sign-up, and every one links back to the article that explains it. See the full data science hub for the tools these prompts are built to run on.

  • 50prompts
  • 1source guide
  • 100%free · no sign-up

The 50 prompts

Copy any of these straight into ChatGPT, Claude or Gemini, then swap the bracketed placeholders for your own details.

50 copy-paste prompts
1Comprehensive Data Profile
Act as a data quality analyst. I am providing you with a pandas DataFrame named `df`. Its schema is as follows: `[[PASTE SCHEMA OR HEAD() OUTPUT HERE]]`. Your task is to perform a comprehensive data profiling. For each column, provide: 1. Data type. 2. Number and percentage of missing values. 3. Number of unique values (cardinality). 4. For numeric columns: mean, median, standard deviation, min, and max. 5. For categorical columns: a list of unique values and their frequencies. 6. Identify any columns that appear to be incorrectly typed (e.g., dates stored as objects). Present the output as a markdown table.
2Missing Value Imputation Plan
has missing values. Here is the output of
3Outlier Detection Script
Generate a Python script that uses the Interquartile Range (IQR) method to identify outliers in the following numeric columns of a pandas DataFrame `df`: `[[LIST_OF_NUMERIC_COLUMNS]]`. The script should: 1. Calculate Q1, Q3, and IQR for each specified column. 2. Define the upper and lower bounds (Q1 - 1.5 * IQR, Q3 + 1.5 * IQR). 3. Create a new DataFrame containing only the rows that have outlier values in any of the specified columns. 4. Print the shape of the original DataFrame and the outlier DataFrame.
4Data Type Conversion Script
. The following columns need their data types corrected: -
5Duplicate Record Identification
. I want to check for duplicates based on a subset of columns:
6Text Normalization Function
that takes a string and performs the following text cleaning steps: 1. Converts the text to lowercase. 2. Removes all punctuation. 3. Removes numerical digits. 4. Removes common English stop words. 5. Stems the remaining words using the Porter Stemmer. The function should return the cleaned string. Include imports from
7Generate Univariate Analysis Plots
, generate a set of Python plots for univariate analysis. For each numeric column in
8Correlation Matrix and Interpretation
Generate Python code to calculate the Pearson correlation matrix for the numeric columns in my pandas DataFrame `df`. The columns are: `[[LIST_OF_NUMERIC_COLUMNS]]`. Then, do the following: 1. Create a heatmap of the correlation matrix using seaborn. Annotate the values on the heatmap. 2. Identify and list all pairs of variables with a correlation coefficient greater than 0.7 or less than -0.7. 3. For the top 3 most correlated pairs, provide a one-sentence hypothesis for why they might be correlated.
9Bivariate Analysis: Numeric vs. Categorical
. For each numeric variable, generate a box plot that compares its distribution across the different categories of
10Time Series Decomposition
with a datetime index and a column named
11Customer Segmentation with K-Means
. Generate a Python script that: 1. Standardizes these two columns using
12Geospatial Data Visualization
with latitude and longitude columns named
13Brainstorm Feature Ideas
[[TARGET_VARIABLE, e.g., 'customer lifetime value']]
14Create Time-Based Features
. Generate a Python script that creates the following new features from this column: - Year - Month - Day of week (as a number, 0=Monday) - Day of year - Week of year - A binary flag
15Generate Interaction Features
Generate Python code to create interaction features for a machine learning model. My pandas DataFrame `df` has the following numeric features: `[[COLUMN_A, COLUMN_B, COLUMN_C]]`. Create all pairwise interaction features (e.g., A*B, A*C, B*C). Add these new features to the DataFrame.
16One-Hot Encode Categorical Features
to one-hot encode the following categorical columns in my DataFrame
17Bin Numeric Features
. Generate Python code to create a new column
18Create Lag Features for Time Series
is indexed by date and has a target column
19Compare Baseline Classification Models
Act as an AutoML specialist. I have a preprocessed dataset with features `X` and a binary target variable `y`. Generate a complete Python script that trains and evaluates three different baseline classification models: 1. Logistic Regression 2. Random Forest Classifier 3. Gradient Boosting Classifier (using LightGBM) For each model, the script should: - Use 5-fold cross-validation. - Calculate and print the mean Accuracy, Precision, Recall, and F1-score. - Store the results in a pandas DataFrame for easy comparison.
20Hyperparameter Tuning with Grid Search
from scikit-learn. My feature matrix is
21Build a Simple Neural Network with Keras
features. The network architecture should be: - Input layer with
22Set up a Scikit-learn Pipeline
pipeline for a machine learning workflow. The pipeline should consist of the following steps: 1. Impute missing numeric values using
23Train a Time Series Forecasting Model (ARIMA)
containing a univariate time series. Generate a Python script using
24Build a Recommendation Engine with Surprise
library to build a simple user-item collaborative filtering recommendation model. Assume I have a pandas DataFrame
25Plot a Confusion Matrix
to compute and plot a confusion matrix. The plot should be clearly labeled with axes titles ('Predicted Label', 'True Label') and the class names
26Plot ROC Curve and Calculate AUC
Using `y_test` (true labels) and `y_pred_proba` (predicted probabilities for the positive class from my classifier), generate a Python script to: 1. Calculate the AUC (Area Under the Curve) score. 2. Plot the ROC (Receiver Operating Characteristic) curve. 3. Include a diagonal line representing a random classifier for comparison. 4. Label the plot with the AUC score.
27Explain a Prediction with SHAP
. I want to explain a single prediction for a specific instance
28Get Global Feature Importance
I have a trained `RandomForestClassifier` model named `model`. My features have the names `[[LIST_OF_FEATURE_NAMES]]`. Generate Python code to extract the feature importances from the model, match them with their names, and create a horizontal bar plot showing the top 15 most important features.
29Perform a Permutation Importance Test
sklearn.inspection.permutation_importance
30Plot a Calibration Curve
I want to check if my binary classifier's predicted probabilities are well-calibrated. I have the true labels `y_test` and the predicted probabilities `y_pred_proba`. Generate a Python script using `sklearn.calibration.CalibrationDisplay` to plot a calibration curve for my model.
31Summarize Model Performance for Executives
[[TARGET_VARIABLE, e.g., 'employee attrition']]
32Describe a Key Insight from a Plot
Below is a Python script that generates a plot. After the script, I will describe the plot. Your task is to write a concise, one-paragraph interpretation of this insight for a business audience. Avoid technical jargon. `[[PASTE PYTHON PLOT SCRIPT]]` The plot shows a bar chart where customers in the 'Tier 1' support category have an average monthly spend of $150, while customers in the 'Tier 3' category have an average spend of $45. Now, write the business summary.
33Create a Business-Focused Visualization
with the results of an A/B test. It has columns
34Draft an Email Reporting A/B Test Results
Act as a data analyst. Draft an email to the product team reporting the results of an A/B test for the new "One-Click Checkout" feature. Key findings: - Control group conversion rate: 3.5% - Treatment group (with feature) conversion rate: 4.8% - The result is statistically significant with a p-value of 0.002. - The test ran for 14 days with 50,000 users in each group. Structure the email with a clear subject line, a brief summary of the result, the key numbers, and a recommendation to roll out the feature.
35Explain a Technical Concept Simply
Explain the concept of "overfitting" in machine learning as you would to a sales director. Use an analogy. Keep the explanation under 150 words.
36Generate a Project README
Generate a markdown template for a data science project README file. The template should include the following sections: - Project Title - Business Problem - Data Source - Methodology (Data Cleaning, EDA, Modeling) - Results - How to Run the Code (Dependencies, Instructions) - Key Contacts
37Write a Dockerfile for a Flask API
(the trained model file) The Dockerfile should: 1. Start from a
38Create a Simple Flask API Endpoint
that accepts POST requests with a JSON payload. The script must: 1. Load a pre-trained scikit-learn model from a file named
39Log Model Metrics with MLflow
Generate a Python script snippet that demonstrates how to use MLflow for experiment tracking. The script should: 1. Start an MLflow run. 2. Log two parameters: `learning_rate` and `n_estimators`. 3. Log three metrics: `accuracy`, `precision`, and `recall`. 4. Log the trained model itself as an artifact. 5. End the run.
40Write a GitHub Actions Workflow for CI
branch. The workflow should be named "CI Pipeline" and perform the following jobs: 1. Set up Python 3.9. 2. Install dependencies from
41Unit Test for a Data Cleaning Function
def remove_outliers(df, column_name): Q1 = df[[column_name]].quantile(0.25) Q3 = df[[column_name]].quantile(0.75) IQR = Q3 - Q1 lower_bound = Q1 - 1.5 * IQR upper_bound = Q3 + 1.5 * IQR return df[(df[[column_name]] >= lower_bound) & (df[[column_name]] <= upper_bound)]
42Monitor for Data Drift
, and I have a new batch of production data in
43Chained: Full EDA Report from a CSV
. First, load it into a pandas DataFrame and run a full data profile. Identify missing values, data types, and basic statistics for each column. Show me the output." **Prompt 2 (after AI responds):** "Thank you. Based on that profile, generate a Python script to handle the data cleaning. Impute missing
44Generate Synthetic Data
: integer, normally distributed around a mean of 40 with a standard deviation of 10. -
45Refactor a Jupyter Notebook into a Class
method that takes model hyperparameters. - A
46Convert Python Script to R
import pandas as pd from sklearn.model_selection import train_test_split from sklearn.ensemble import RandomForestClassifier df = pd.read_csv('data.csv') df = df.dropna() X = df[[['feature1', 'feature2']]] y = df[['target']] X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42) model = RandomForestClassifier(n_estimators=100) model.fit(X_train, y_train) print(model.score(X_test, y_test))
47Explain Model Results with Counterfactuals
) for whom the model predicted a high probability of churn (0.92). Explain this prediction using a counterfactual explanation. In plain English, describe the minimal changes to this customer's features (e.g.,
48SQL: Cohort Analysis Query
. The query should calculate the retention rate of monthly customer cohorts. A customer's cohort is the month of their first purchase. Retention for a given month is the percentage of customers from a cohort who made a purchase in that month. The output should have three columns:
49Create an Interactive Dashboard with Plotly
[['date', 'region', 'sales', 'product_category']]
50Write a Dask script for a large CSV
) that won't fit into pandas memory. The task is to calculate the mean of

How to use these data science prompts

Four steps, about a minute. The prompt supplies the structure; you supply the specifics.

1

Pick the prompt

Every prompt here was written for a specific job — not a generic “act as an expert” template. Scan the titles and take the one that matches the task in front of you.

2

Copy and paste it

Hit Copy, then paste the whole thing into ChatGPT, Claude, Gemini or whichever assistant you already pay for. Nothing here is tied to one model.

3

Fill the brackets

Replace every [Bracketed Placeholder] with your own details before you send. That is where the quality comes from — the prompt supplies the structure, you supply the specifics.

4

Check the source guide

The “From” link under each prompt opens the full article: why the prompt is built that way, what it was tested against, and the tools it pairs with.

Frequently asked

The questions people ask before they paste one of these into a real piece of work.

Are these AI prompts free to use?

Yes. All 50 prompts on this page are free to copy and use with any AI assistant, including ChatGPT, Claude and Gemini. You only need an account with one of those tools to run them.

How do I use these AI prompts for data science?

Copy the full prompt text with the Copy button, paste it into your AI assistant of choice, and replace any bracketed placeholder — like [Your City] or [Company Name] — with your own details before you send it.

Where do these prompts come from?

Each prompt is pulled from one of Zekai’s tested prompt guides. The “From” link under every prompt goes to the full article, which explains the reasoning behind the prompt and how it was tested.

Can I edit these prompts?

Please do. Treat each one as a starting structure: tighten the instructions, add your own constraints, and keep the version that gives you the best output. The bracketed placeholders mark the parts that always need changing.

Prompt libraries for other professions

Same format, different job — starting with the ones closest to data science.

See Zekai first in Google