Describe what each row represents, the columns most relevant for
grouping, and the business decisions the segments should inform, and this
prompt finds meaningful groups three ways at once.
It runs rule-based segmentation from business logic, statistical
clustering with an optimal K, and behavioral (recency/frequency/monetary)
segmentation where time-series data exists, then profiles each segment,
names it in plain language, and pairs it with one actionable
recommendation plus the Python code behind it.
List the current messy column names, the target clean names, and your
formatting rules for dates, phone numbers, and category mappings.
- Generates a runnable pandas script standardizing dates and currency
- Splits addresses into street, city, state, and zip
- Splits full names into first_name and last_name, formats phone numbers
- Ends with a before/after validation summary of row counts and samples
Paste in raw analysis results — tables, statistics, key findings — along
with the audience, tone, and target length, and this prompt builds a
narrative instead of a results dump.
It opens with the original question, walks through evidence in logical
order, builds toward the insight rather than front-loading it, addresses
the obvious counterarguments, and closes with a recommendation and
confidence level, marking where charts should sit with [CHART:
description] tags.
Describe the database engine, the available tables with their columns
and relationships, the analysis you need in plain English, and whether
to optimize for large tables or readability, and this prompt writes the
production-ready SQL query to get there. It handles nulls sensibly, uses
CTEs to keep complex logic readable, comments any non-obvious steps, and
returns business-friendly column names instead of raw
database_column_names — useful whenever you know the analysis you want
but not the SQL to write it.