In the pack: ChatGPT, Claude & Gemini Prompts for Data Analysis, Excel & Google Sheets
pandas Code to Load, Reshape and Summarise Data
Prompt
Python and pandas versions if known: {{PYTHON_ENVIRONMENT}}
File type and columns with types, plus three sample rows: {{DATA_STRUCTURE}}
What I want to end up with (a tidy table, a pivot, a grouped summary, a merged dataset): {{TARGET_RESULT}}
Known problems (mixed types, odd date formats, large file): {{KNOWN_ISSUES}}
Write a complete snippet. Rules:
- Use only the column names I gave. Ask me if any are unclear.
- Load with explicit dtypes and date parsing where relevant, and explain why.
- Prefer method chaining with clear step names; avoid chained assignment and inplace operations.
- Comment each step in plain English.
- Add assert or shape checks after merges and filters so a silent row explosion or loss is caught.
- Handle missing values explicitly and say how.
Output: the code, a table of what each step changes (row count and columns), a quick test on my three sample rows with the expected output, and a note about any pandas feature that depends on version. Tell me not to upload confidential files to online code tools I don't control.
Customize this prompt
Fill in the variables below to personalize this prompt:
Model Settings
Recommended Models
Temperature
Max Tokens
Additional Notes
About this prompt
“pandas Code to Load, Reshape and Summarise Data” is a free prompt for ChatGPT in the Coding & Software category, 189 words long, added to The Prompt Index on October 28, 2026 by The Prompt Index. Copy it with the button above, paste it into ChatGPT or any other AI chat assistant, and send it.
It has 4 placeholders to fill in first:
{{PYTHON_ENVIRONMENT}}, {{DATA_STRUCTURE}}, {{TARGET_RESULT}}, {{KNOWN_ISSUES}}.
Use the “Customize this prompt” fields to personalise it before you copy.
Recommended models: ChatGPT, Claude, Gemini.
0 upvotes, sent to an AI tool 0 times, viewed 4 times.
Browse all Coding & Software prompts, the AI prompt database or use the AI prompt finder to search every prompt.