Skip to content
Agentmart
Submit a tool

data-cleaning

数据清洗最佳实践 — 空值处理、去重、格式统一、异常值检测、分列操作

Skill by claude-office-skills

IndexedMIT★ 9
Write a review

Chalk Labs

Need help deploying data-cleaning?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/claude-office-skills-data-cleaning

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

数据清洗最佳实践 — 空值处理、去重、格式统一、异常值检测、分列操作

Use cases: data

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/data-cleaning

What's inside

Skill name
data-cleaning
Description
数据清洗最佳实践 — 空值处理、去重、格式统一、异常值检测、分列操作
License
MIT
Instructions
105 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

## 数据清洗操作规范

### 空值/空白处理策略

根据用户意图选择策略,不要自行决定删除数据:

```javascript
var ws = Application.ActiveSheet;
var ur = ws.UsedRange;
var lastRow = ur.Row + ur.Rows.Count - 1;
var lastCol = ur.Column + ur.Columns.Count - 1;

// 策略1: 删除整行空白行
for (var r = lastRow; r >= 2; r--) {
  var empty = true;
  for (var c = 1; c <= lastCol; c++) {
    if (ws.Range(CL(c) + r).Value2 !== null && ws.Range(CL(c) + r).Value2 !== "") {
      empty = false; break;
    }
  }
  if (empty) ws.Range(r + ":" + r).Delete();
}

// 策略2: 用指定值填充空白
for (var r = 2; r <= lastRow; r++) {
  if (ws.Range(CL(col) + r).Value2 === null || ws.Range(CL(col) + r).Value2 === "") {
    ws.Range(CL(col) + r).Value2 = fillValue;
  }
}

// 策略3: 用上一行值向下填充
for (var r = 3; r <= lastRow; r++) {
  if (ws.Range(CL(col) + r).Value2 === null || ws.Range(CL(col) + r).Value2 === "") {
    ws.Range(CL(col) + r).Value2 = ws.Range(CL(col) + (r - 1)).Value2;
  }
}
```

### 去重逻辑

```javascript
// 按指定列去重,保留首次出现
var seen = {};
var delRows = [];
for (var r = 2; r <= lastRow; r++) {
  var key = String(ws.Range(CL(keyCol) + r).Value2);
  if (seen[key]) { delRows.push(r); }
  else { seen[key] = true; }
}
for (var i = delRows.length - 1; i >= 0; i--) {
  ws.Range(delRows[i] + ":" + delRows[i]).Delete();
}

// 多列组合去重
var key = cols.map(function(c) { return String(ws.Range(CL(c) + r).Value2); }).join("||");
```

### 格式统一

```javascript
// 日期格式统一(文本 → 标准日期)
var v = String(ws.Range(CL(c) + r).Value2);
// 处理 2024/1/5、2024.1.5、20240105 等变体
var m = v.match(/(\d{4})[\/\.\-]?(\d{1,2})[\/\.\-]?(\d{1,2})/);
if (m) {
  ws.Range(CL(c) + r).Value2 = m[1] + "-" + ("0" + m[2]).slice(-2) + "-" + ("0" + m[3]).slice(-2);
}

// 数字格式统一
ws.Range(CL(c) + "2:" + CL(c) + lastRow).NumberFormat = "#,##0.00";

// 文本去空格/换行
var v = String(ws.Range(CL(c) + r).Value2).replace(/[\s\n\r]+/g, " ").trim();
```

### 异常值检测

```javascript
// IQR 方法检测异常值
var vals = [];
for (var r = 2; r <= lastRow; r++) {
  var v = ws.Range(CL(c) + r).Value2;
  if (typeof v === "number") vals.push(v);
}
vals.sort(function(a, b) { return a - b; });
var q1 = vals[Math.floor(vals.length * 0.25)];
var q3 = vals[Math.floor(vals.length * 0.75)];
var iqr = q3 - q1;
var lower = q1 - 1.5 * iqr, upper = q3 + 1.5 * iqr;
// 标记异常值(黄色背景)
for (var r = 2; r <= lastRow; r++) {
  var v = ws.Range(CL(c) + r).Value2;
  if (typeof v === "number" && (v < lower || v > upper)) {
    ws.Range(CL(c) + r).Interior.Color = 0x00AAFF; // 橙黄标记
  }
}
```

### 安全规则

- 清洗前询问用户策略,不要自行决定删除/修改
- 大范围操作建议先在新工作表预览结果
- 空值处理必须说明选择了哪种策略及原因

From claude-office-skills/claude-office-plugin, MIT.

More from claude-office-skills/claude-office-plugin

Signals

Stars
9
Forks
3
Open issues
0
Last commit (this folder)
Mar 9, 2026 (8 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from claude-office-skills

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get data-cleaning running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying data-cleaning?

CallGet help
Cite this page

data-cleaning skill. Agent Mart. https://agentmart.dev/skills/claude-office-skills-data-cleaning (last updated 2026-10-24)