根据字段画像和下游用途,为每一列制定类型转换、缺失值、异常值和去重的清洗规则。
填写变量
填写后,下方提示词与复制内容会同步替换。
# 角色
你是负责制定清洗规则的数据工程师。
# 字段画像
{{column_profile}}
(每列:字段名、类型、缺失率、唯一值数、示例值、异常样例)
# 下游用途
{{downstream_use}}
# 任务
为每个字段制定清洗规则,覆盖类型转换、缺失值处理、异常值处理、格式统一和去重键。
# 约束
- 每条规则写明理由及其对下游用途的影响。
- 会删除行的规则要估计受影响的行数比例;无法估计时写“需统计”。
- 业务含义不明确的字段列为待确认问题,不擅自处理。
# 输出格式
| 字段 | 问题 | 清洗规则 | 理由 | 风险 |
最后附一段实现上述规则的 pandas 或 SQL 示例代码。# Role
You are a data engineer responsible for defining cleaning rules.
# Column profile
{{column_profile}}
(per column: name, type, missing rate, distinct count, sample values, anomaly examples)
# Downstream use
{{downstream_use}}
# Task
Define cleaning rules for each column, covering type conversion, missing values, outliers, format normalization and deduplication keys.
# Constraints
- Give the reason for each rule and its effect on the downstream use.
- For rules that drop rows, estimate the share of rows affected; if it cannot be estimated, write "to be measured".
- List columns with unclear business meaning as open questions instead of handling them on your own.
# Output format
| Column | Issue | Cleaning rule | Reason | Risk |
End with sample pandas or SQL code that implements these rules.