P

GitHub Copilot Prompt for Survey Analysis

Survey analysis is a crucial step to extract actionable insights from raw data. GitHub Copilot, through its code generation and contextual understanding capabilities, becomes a powerful ally to automate response processing, identify statistical trends, and produce relevant visualizations. Whether you work with CSV files exported from Google Forms, Typeform, or SurveyMonkey, Copilot can help you quickly write Python or R code to clean data, calculate distributions, perform cross-tabulations, and generate clear charts. Instead of spending hours manually manipulating spreadsheets, you can describe in natural language what you want to analyze and let Copilot generate the corresponding code. This approach is particularly effective for product teams, UX researchers, and marketing managers who need to quickly transform hundreds of responses into concrete recommendations. The prompt below is designed to maximize the relevance of Copilot's suggestions by clearly structuring your analysis expectations.

The prompt

GitHub Copilot

Complete survey analysis

Source file: survey_results.csv

Columns: timestamp, age_group, satisfaction (1-5), recommend (yes/no), open_feedback

import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns

1. Load data and display a statistical summary (number of respondents, completion rate, distribution by age group)

2. Calculate the average satisfaction score overall and by demographic segment (age_group)

3. Calculate the Net Promoter Score (NPS) from the recommend column

4. Identify correlations between satisfaction and propensity to recommend

5. Extract recurring themes in open-ended responses (open_feedback) with keyword frequency counting

6. Generate 4 visualizations: satisfaction distribution (histogram), NPS by segment (barplot), word cloud of feedback, correlation matrix

7. Produce an executive summary in markdown with the top 5 insights and 3 actionable recommendations

Personalize this prompt with Léa

Answer 3 questions and Léa tailors the prompt to your situation.

Why it works

This prompt works because it provides Copilot with the complete dataset context (filename, exact columns, data types) and breaks down the analysis into precise numbered steps. The sequential comment structure guides Copilot to generate code block by block rather than a monolithic response. Including specific metrics (NPS, correlations, textual analysis) forces relevant technical suggestions rather than generic code.

Expected result

Copilot generates a complete Python script that loads the CSV, produces descriptive statistics by segment, calculates NPS, and creates four professional visualizations with Matplotlib and Seaborn. The script also includes term frequency analysis on open-ended responses and an executive summary formatted in markdown ready to share with stakeholders.

Variants by level

FAQ

Can GitHub Copilot directly analyze a CSV file without me writing code?
No, GitHub Copilot does not directly process data files. It functions as a code assistant that generates analysis scripts from your descriptive comments. You need to open a Python file or Jupyter Notebook in VS Code, describe your analysis in comments, and Copilot will suggest the corresponding code. The advantage is that you get a reproducible pipeline that you can rerun with each new wave of responses.
How do I adapt the prompt if my survey uses different scales (7-point Likert, multiple choice, ranking)?
Modify the prompt comments to explicitly specify the type and scale of each question. For example, replace 'satisfaction (1-5)' with 'satisfaction (Likert 1-7)' or 'multiple_choice (values: A, B, C, D)'. The more precise you are about the data structure, the more adapted the code Copilot generates. For multiple-choice questions separated by commas in a single cell, add a comment indicating the format: '# column preferred_features: multiple values separated by commas, to be split with str.split'.
Can Copilot help me analyze open-ended responses from a French survey?
Yes, but with some precautions. In your prompt, explicitly state that the texts are in French so that Copilot uses the correct stopwords and tokenization parameters. Add a comment like '# Texts in French: use NLTK French stopwords and spaCy fr_core_news_sm for NLP'. Copilot will then suggest code with the appropriate libraries and language models. For sentiment analysis in French, it will point to models like CamemBERT rather than English tools.

Related prompts

How to use this prompt

  1. Copy the prompt with the button above.
  2. Paste it into ChatGPT, Claude or your favorite AI assistant.
  3. Replace the bracketed variables with your details, then refine the result.

About Prompt Guide

Prompt Guide is a free library of 2500+ ready-to-use prompts for ChatGPT, Claude and other AIs, with guides to learn prompting and tools to build and optimize your own prompts.

More prompts to explore

Go further

Get new prompts every week

Join our newsletter.