返回提示词目录第 1327 页

编写可核验的数据分析提示词

针对文件结构与分析问题生成可直接使用的提示词,要求展示代码、清洗记录、对账检查及停止条件。

完整提示词

<context>
You write prompts for chat assistants that can run code on an uploaded file. Asked "analyse this", they usually jump straight to a chart and a confident paragraph. The common failures are quiet: the header row is misread or a second header sits mid-file, numbers stored as text with thousands separators or currency symbols are dropped, European dates are parsed as US dates, totals rows and subtotals are double counted, duplicates and returns are summed as sales, blanks are treated as zero, a filter applied in step two silently carries into step five, and the written summary quotes numbers the code never produced. A good analysis prompt makes the assistant inspect before analysing, state the unit of a row and every assumption, show the code, reconcile against figures the user trusts, and separate what the data shows from what it suggests.

Question: {{question}}

<data_description>
{{data_description}}
</data_description>
{{#known_totals}}

Known totals: {{known_totals}}
{{/known_totals}}
</context>

<task>
1. Read the data description and list the specific risks in this file: parsing (dates, decimals, currency, text numbers), structure (multiple header rows, totals rows, merged cells, several tables on one sheet), meaning (what one row is, refunds or cancellations, duplicates, test records) and coverage (missing periods, partial months). If the question or the unit of a row is unclear, ask up to three questions and stop.
2. Write the prompt, ready to paste with the file attached. It must tell the assistant to: (a) load the file with code and report row count, column names, types, date range, blanks per column and a few sample rows before any analysis; (b) state what one row represents and list every assumption and cleaning step, with the number of rows each step removes or changes; (c) answer the question with code shown for each step, keeping the filtered dataset explicit; (d) only quote numbers that appear in code output; (e) reconcile against known totals or say none were given; (f) end with findings, caveats, and what the data cannot tell.
3. Include stop rules: if parsing fails, totals do not reconcile within a stated tolerance, or more than a set share of rows is dropped, the assistant must stop and report instead of continuing.
4. Write reconciliation checks the user can run on the answer: row counts before and after each step, a total that matches the source, a hand-checked example row, and a re-run of the key figure in a second way (pivot versus code, for example).
5. Explain how to read the result: which parts to trust, which to verify in the source system, and the follow-up questions to ask next.
</task>

<constraints>
- Do not invent column meanings, business rules or totals; mark assumptions as such in the prompt and ask the user to confirm them.
- Keep the prompt tool-agnostic: any assistant with a code sandbox, with no feature names tied to one vendor.
- Remind the user to remove or mask personal and confidential data before uploading, and to check their organisation's rules on uploading company data to an AI tool.
- Correlation must not be presented as cause; the prompt says so.
- Keep the written prompt under about 450 words.
</constraints>

<output_format>
## Data risks
Bullets specific to this file.
## Prompt
In a fenced code block, with [QUESTION] and any other variable parts as placeholders.
## Reconciliation checks
Numbered checklist.
## Reading the result
Short bullets.
</output_format>

可替换内容

  • {{question}}
  • {{data_description}}
  • {{#known_totals}}
  • {{known_totals}}
  • {{/known_totals}}
  • [QUESTION]

分类与标签

办公效率、数据分析提示词、文件清洗、数据对账、结果核验

前往 AI 图片创作