场景 022 · Codex Use Case

分析数据集并交付报告

使用 ChatGPT Work 清理数据、关联来源、探索问题、建立模型,并交付附有图表和局限说明的清晰报告。

DataAnalysis
Analyze datasets and ship reportsDataAnalysis

原文核对:2026-10-13 · 中文正文 · 英文提示词与演示

场景定位

使用 ChatGPT Work 清理数据、关联来源、探索问题、建立模型,并交付附有图表和局限说明的清晰报告。

难度
中级
时间跨度
1 小时

适合用于

  • 从杂乱文件出发,最终交付图表、备忘录、仪表盘或报告的数据分析。
  • 需要清理、可靠关联、可解释模型或可复现分析的问题。
  • 需要产物可被他人审阅和复用的团队。

相关工具

Spreadsheets

检查 CSV、TSV 和 Excel 文件,核验公式和数据关联,并创建便于审阅的表格或图表。

Google Drive

读取你指定且获准使用的 Google Sheets 和 Drive 源文件。

Google Drive ↗
Data Analytics

收集来源背景、分析和验证数据,构建可复用的报告、仪表盘、图表或 notebook。

起步提示词

英文原文 · 可复制后按实际材料修改

Use @Data Analytics to inspect the attached property-sales and highway-distance datasets and determine whether homes near the highway have lower property values.

Explain what each source contains, identify the relevant columns and likely join keys, and check for missing values, duplicates, unmatched records, and incomplete data. Clean and join the inputs without overwriting the source files or inventing values.

Explore the question with clear supporting charts, start with an interpretable model when modeling is useful, and explain the result, assumptions, and uncertainty in plain language. Return a concise report, notebook, or spreadsheet with the answer first, name the files you create, and flag any data issue that could change the conclusion.

简介

数据分析的核心是用数据支持决策。目标是产出能帮助他人行动的成果:管理层使用的图表、产品团队的实验结论、研究人员的模型评估,或指导日常运营的仪表盘。

《R for Data Science》推广的一种实用框架是循环:先导入并整理数据,再在转换、可视化和建模之间迭代,形成理解后传达结果。

ChatGPT Work 很适合这一流程。它可以帮助清理数据、探索假设、生成分析,并产出可复现的成果。目标是让其他人能够审阅、信任并重跑分析,而非一次性的 notebook。

定义你的问题

选一个希望用数据回答的具体问题。问题越明确,越容易确定输入、检查方法和输出。

贯穿示例:高速公路附近的房产价值

下面以这个问题为例:

靠近高速公路的房屋,其估值在多大程度上更低?

假设一份数据包含房产估值或售价,另一份包含位置、地块或与高速公路距离相关的信息。除了运行模型,还要确保输入可信、记录关联方式、检验结论的稳健性,最终交付他人能使用的成果。

可以上传 CSV 或 Excel,通过 @google-drive 指定获准访问的 Google Sheet;若数据在本机,也可以使用桌面应用。

查看官方对话演示(英文)

ChatGPT Work conversation showing property data checks, a highway-proximity analysis, a report, and a follow-up question.

用户

Use @Data Analytics to inspect the attached property-sales and highway-distance datasets and determine whether homes near the highway have lower property values. Explain what each source contains, identify the relevant columns and likely join keys, and check for missing values, duplicates, unmatched records, and incomplete data. Clean and join the inputs without overwriting the source files or inventing values. Explore the question with clear supporting charts, start with an interpretable model when modeling is useful, and explain the result, assumptions, and uncertainty in plain language. Return a concise report, notebook, or spreadsheet with the answer first, name the files you create, and flag any data issue that could change the conclusion.

ChatGPT

Spreadsheets · Inspected the property sales and highway-distance files

Spreadsheets · Verified property IDs and flagged one unmatched sale

Spreadsheets · Created a property-value report and comparison chart

I checked the fictional property sales and highway distances. Eleven sales matched; one didn't have a recorded highway distance and was excluded. The five homes within one mile averaged $⁠500,000, compared with $⁠600,000 for the six homes two to five miles away. I created highway-property-report.md and highway-property-comparison.svg. The report flags the small sample and explains that the comparison doesn't establish causation or control for neighborhood, timing, traffic, or noise.

用户

Does the difference hold if you exclude the highest-priced property?

ChatGPT

Spreadsheets · Rechecked the comparison without the highest-priced property

Yes. After excluding the highest-priced distant property, the remaining five distant homes average $⁠594,000. The nearby homes still average $⁠500,000, leaving a $⁠94,000 difference. I added the sensitivity check and its limitations to the report.

导入数据

先上传文件,请 ChatGPT 检查,回答这些基础但重要的问题:

  • 有哪些文件格式?
  • 每个数据集看起来代表什么?
  • 哪些列可能是目标、标识符、日期、位置或度量?
  • 有哪些明显的数据质量问题?

暂时不要要求结论,先要求盘点和解释。

整理和合并输入

真实工作往往从这里开始:有两份或更多数据集,主键不清楚,直接合并可能丢失数据或产生重复记录。

让 ChatGPT 在实际合并前先检查关联情况:

  • 检查候选键是否唯一。
  • 统计空值比例和格式差异。
  • 规范大小写、空白或地址格式等明确的格式问题。
  • 试运行关联并报告匹配率。
  • 写入最终合并文件前,建议最稳妥的合并策略。

如果需要推导最佳键,例如标准化地址、由多列组合的地块标识符,或按位置关联,应在接受合并前让 ChatGPT 解释取舍和边缘情况。

通过图表探索

选择模型前先用图表理解数据。在高速公路示例中,比较近处和远处的房屋,检查异常值、缺失值模式,以及表面上的影响是否源于社区构成、房屋面积或其他因素。

让每张图都对应最初的问题,并保存有用的对比,方便他人检查分析。

为问题建模

并非每次分析都需要复杂模型。先从可解释的基线开始。

对于高速公路问题,合理的首轮方法是回归或其他透明模型:控制面积、房龄、位置等相关因素,估计与高速公路的距离和房产价值之间的关系。

要求 ChatGPT 明确说明:

  • 目标变量和特征的定义。
  • 加入哪些控制变量,以及原因。
  • 数据泄漏风险和排除条件。
  • 如何选择数据划分、评估方法或不确定性估计。
  • 用通俗语言解释结果的含义。

即使首个模型表现不佳,也有帮助:它能提示问题出在模型、特征、关联质量,还是问题本身。

传达结果

只有其他人能够使用时,分析才有价值。请按受众需要交付成果:

  • 面向技术协作者的 Markdown 备忘录。
  • 供后续运营使用的电子表格或 CSV。
  • 面向决策者的排版文档或 PDF。
  • 便于复用分析的 notebook、仪表盘或静态报告。

要求明确写出局限。如果关联质量不完善、存在抽样偏差,或模型假设脆弱,交付物应清楚说明。

可选:设置 Python 环境

如果项目需要复用脚本或 notebook,可以让 ChatGPT 使用现有 Python 环境,或设置一个小型、可复现的环境。保持源文件不变,将分析、图表和最终报告单独保存。在 ChatGPT Work 中分析上传的文件前,不必先设置 Python。

提示词示例

加载并解释数据集

官方提示词

英文原文 · 可复制后按实际材料修改

Review the data files I've attached and explain what each one contains. Identify likely target columns, dates, parcel or location identifiers, file formats, missing information, and obvious quality issues. Don't draw conclusions yet.

实际关联前检查合并方案

官方提示词

英文原文 · 可复制后按实际材料修改

Check how these datasets should be joined. Profile the candidate keys, show duplicate and unmatched records, normalize obvious formatting issues, and explain the safest join. Don't invent missing values or overwrite the source files.

建立可解释的首个模型

官方提示词

英文原文 · 可复制后按实际材料修改

Model whether highway proximity is associated with lower property values. Start with an interpretable baseline, account for home size, age, and neighborhood where the data supports it, and explain the effect, uncertainty, and limitations in plain language.

为相关人员打包结果

官方提示词

英文原文 · 可复制后按实际材料修改

Turn this analysis into a short, stakeholder-ready report. Put the answer first, include the most useful supporting charts, explain the data and join checks, and clearly flag any limitations or uncertainty. Keep the source data unchanged and name the files you create.

技术栈

需要默认选项用途
分析工具pandas 配合 matplotlib 或 seabornpandas ↗matplotlib ↗seaborn ↗适合导入、数据概况、关联、清理和首轮图表。
建模statsmodels 或 scikit-learnstatsmodels ↗scikit-learn ↗先建立可解释的基线,再考虑更复杂的预测模型。
展开英文原文对照

Use ChatGPT Work to clean data, join sources, explore a question, model the result, and produce a clear report with supporting charts and caveats.

Introduction

At its core, data analysis is about using data to inform decisions. The goal isn’t analysis for its own sake. It’s to produce an artifact that helps someone act: a chart for leadership, an experiment readout for a product team, a model evaluation for researchers, or a dashboard that guides daily operations.

A useful framework, popularized by R for Data Science, is a loop: import and tidy data, then iterate between transform, visualize, and model to build understanding before you communicate results.

ChatGPT Work fits well into this workflow. It helps you clean data, explore hypotheses, generate analyses, and produce reproducible artifacts. The target isn’t a one-off notebook. It’s an analysis that other people can review, trust, and rerun.

Define your use case

Choose one concrete question you want to answer with your data. The more specific the question, the easier it is to identify the right inputs, checks, and result.

Running example: Property values near the highway

As an example, we’ll explore the following question:

To what extent are houses near the highway lower in property valuation?

Suppose one dataset contains property values or sale prices, and another contains location, parcel, or highway-proximity information. The work isn’t only to run a model. It’s to make the inputs trustworthy, document the joins, pressure-test the result, and end with an artifact that somebody else can use.

You can attach CSVs or Excel workbooks, name an approved Google Sheet with @google-drive, or use the desktop app when your data is stored on your computer.

查看官方对话演示(英文)

ChatGPT Work conversation showing property data checks, a highway-proximity analysis, a report, and a follow-up question.

用户

Use @Data Analytics to inspect the attached property-sales and highway-distance datasets and determine whether homes near the highway have lower property values. Explain what each source contains, identify the relevant columns and likely join keys, and check for missing values, duplicates, unmatched records, and incomplete data. Clean and join the inputs without overwriting the source files or inventing values. Explore the question with clear supporting charts, start with an interpretable model when modeling is useful, and explain the result, assumptions, and uncertainty in plain language. Return a concise report, notebook, or spreadsheet with the answer first, name the files you create, and flag any data issue that could change the conclusion.

ChatGPT

Spreadsheets · Inspected the property sales and highway-distance files

Spreadsheets · Verified property IDs and flagged one unmatched sale

Spreadsheets · Created a property-value report and comparison chart

I checked the fictional property sales and highway distances. Eleven sales matched; one didn't have a recorded highway distance and was excluded. The five homes within one mile averaged $⁠500,000, compared with $⁠600,000 for the six homes two to five miles away. I created highway-property-report.md and highway-property-comparison.svg. The report flags the small sample and explains that the comparison doesn't establish causation or control for neighborhood, timing, traffic, or noise.

用户

Does the difference hold if you exclude the highest-priced property?

ChatGPT

Spreadsheets · Rechecked the comparison without the highest-priced property

Yes. After excluding the highest-priced distant property, the remaining five distant homes average $⁠594,000. The nearby homes still average $⁠500,000, leaving a $⁠94,000 difference. I added the sensitivity check and its limitations to the report.

Import the data

Start by attaching the files and asking ChatGPT to inspect them. This helps answer basic but important questions:

  • What file formats are here?
  • What does each dataset seem to represent?
  • Which columns might be targets, identifiers, dates, locations, or measures?
  • Where are the clear quality issues?

Don’t ask for conclusions yet. Ask for inventory and explanation first.

Tidy and merge the inputs

Most real work starts here. You have two or more datasets, the primary key isn’t clear, and a naive merge could lose data or create duplicates.

Ask ChatGPT to profile the merge before performing it:

  • Check uniqueness for candidate keys.
  • Measure null rates and formatting differences.
  • Normalize clear formatting issues such as casing, whitespace, or address formatting.
  • Run trial joins and report match rates.
  • Recommend the safest merge strategy before it writes the final merged file.

If you need to derive the best key, such as a normalized address, a parcel identifier built from a few columns, or a location join, ask ChatGPT to explain the tradeoffs and edge cases before you accept the merge.

Explore with charts

Use charts to understand the data before choosing a model. In the running example, compare homes near the highway with homes farther away, examine outliers, inspect missing-value patterns, and check whether the apparent effect reflects neighborhood composition, home size, or another factor.

Keep each chart tied to the original question. Save the useful comparisons so another person can inspect the analysis.

Model the question

Not every analysis needs a complex model. Start with an interpretable baseline.

For the highway question, a sensible first pass is a regression or other transparent model that estimates the relationship between highway proximity and property value while controlling for relevant factors such as size, age, and location.

Ask ChatGPT to be explicit about:

  • The target variable and feature definitions.
  • Which controls to include and why.
  • Leakage risks and exclusions.
  • How it chose the split, evaluation, or uncertainty estimate.
  • What the result means in plain language.

If the first model is weak, that’s still useful. It tells you whether the problem is the model, the features, the join quality, or the question itself.

Communicate the result

The analysis is only useful when someone else can consume it. Ask ChatGPT to produce the artifact the audience needs:

  • A Markdown memo for technical collaborators.
  • A spreadsheet or CSV for downstream operations.
  • A formatted document or PDF for decision-makers.
  • A notebook, dashboard, or static report for a reusable analysis.

Ask it to include caveats. If the join quality is imperfect, sampling bias is present, or model assumptions are fragile, the deliverable should say so plainly.

Optional: set up a Python environment

If the project needs reusable scripts or a notebook, ask ChatGPT to use the existing Python environment or set up a small, reproducible one. Keep source files unchanged and save the analysis, charts, and final report separately. You don’t need to set up Python before analyzing attached files in ChatGPT Work.

Suggested prompts

Load the datasets and explain them

官方提示词

英文原文 · 可复制后按实际材料修改

Review the data files I've attached and explain what each one contains. Identify likely target columns, dates, parcel or location identifiers, file formats, missing information, and obvious quality issues. Don't draw conclusions yet.

Check the merge before joining

官方提示词

英文原文 · 可复制后按实际材料修改

Check how these datasets should be joined. Profile the candidate keys, show duplicate and unmatched records, normalize obvious formatting issues, and explain the safest join. Don't invent missing values or overwrite the source files.

Build an interpretable first model

官方提示词

英文原文 · 可复制后按实际材料修改

Model whether highway proximity is associated with lower property values. Start with an interpretable baseline, account for home size, age, and neighborhood where the data supports it, and explain the effect, uncertainty, and limitations in plain language.

Package the results for stakeholders

官方提示词

英文原文 · 可复制后按实际材料修改

Turn this analysis into a short, stakeholder-ready report. Put the answer first, include the most useful supporting charts, explain the data and join checks, and clearly flag any limitations or uncertainty. Keep the source data unchanged and name the files you create.