excel-find-duplicates
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "excel-find-duplicates":https://skillpi.com/zh/skills/deepskill-57b2cf9597b33de33ae5be4ae5aee9f92c76643768cd8eb106a5a7fdef3767be。安装前核对上游来源和版本:https://skillhub.cn/skills/user_8f803df1/excel-find-duplicates。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
skillhub.cn
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
Excel 查重工具(只读扫描)。按指定列扫描 Excel 文件并输出重复行号列表,不修改原文件。通常与 excel-delete 配合使用以实现无损去重。触发词示例:"查重"、"找重复"、"检查重复"、"重复行"、"有哪些重复"。
介绍来源: third_party · user_8f803df1 · 1.0.0 参考来源
SkillPi 解读
- 能完成的任务
- This skill is read-only, no side effects. Follows [[excel-safe-workflow]] Scout→Analyze two-step approach. 本技能只读不写,安全无副作用。遵循 [[excel-safe-workflow]] 勘察→分析两步。
- 软件、账号及付费要求
- | Element / 要素 | Common Phrasing / 常见表述 | Default / 默认值 | |------|---------|--------| | **Key Column(s) / 关键列** | "By patent number" / "Column E" / "按专利号查""E列" | Must be explicit / 必须明确 | | **Keep Strategy / 保留策略** | "Keep first" / "Keep latest" / "保留第一个""保留最新的" | Keep first occurrence / 保留首次出现 | | **Output Format / 输出格式** | Directly return row number list / 直接返回行号列表 | Excel row numbers / Excel 行号 |
- 限制与区别
- 1. **Read-only / 只读**:Does not modify original file, safe to run / 不修改原文件,放心跑 2. **Row numbers are Excel row numbers / 行号是 Excel 行号**:Row 1 = header, Row 2 = first data row / 第1行=表头,第2行=第一条数据 3. **Large files / 大文件**:pandas reading 168MB/330K rows takes ~150s / pandas 读取 168MB/33万行约 150s 4. **Null values / 空值**:Multiple rows with None in the key column are treated as "duplicates", only the first is kept / 关键列为 None 的多个行会被视为"重复",只保留第一个
- 实测状态
- 未测试
文件浏览
Frontmatter
name: excel-find-duplicates
description: |
Read-only scan of Excel files to find duplicate rows by specified column(s), outputting duplicate row number lists. Does not modify the original file. Typically used in conjunction with excel-delete for safe, format-preserving deduplication.
只读扫描 Excel 文件,按指定列查找重复行,输出重复行号列表。不修改原文件。通常配合 excel-delete 使用实现安全的格式无损去重。
Trigger keywords: "find duplicates" "check duplicates" "scan duplicates" "duplicate rows" "what are the duplicates"
触发词包括"查重""找重复""检查重复""重复行""有哪些重复"。This skill is read-only, no side effects. Follows [[excel-safe-workflow]] Scout→Analyze two-step approach. 本技能只读不写,安全无副作用。遵循 [[excel-safe-workflow]] 勘察→分析两步。
Excel Find Duplicates (Read-only) / Excel 查重(只读)
Function / 功能
- Scan for duplicate rows by specified column(s) (or multi-column combination) / 按指定列(或多列联合)扫描重复行
- Output duplicate statistics and row number list / 输出重复统计和行号列表
- Results can be directly passed to [[excel-delete]] for deletion / 结果可直接传给 [[excel-delete]] 执行删除
Step 0: Requirement Parsing / 第零步:需求解析
| Element / 要素 | Common Phrasing / 常见表述 | Default / 默认值 |
|---|---|---|
| Key Column(s) / 关键列 | "By patent number" / "Column E" / "按专利号查""E列" | Must be explicit / 必须明确 |
| Keep Strategy / 保留策略 | "Keep first" / "Keep latest" / "保留第一个""保留最新的" | Keep first occurrence / 保留首次出现 |
| Output Format / 输出格式 | Directly return row number list / 直接返回行号列表 | Excel row numbers / Excel 行号 |
Step 1: Scout (Read-only Scan) / 第一步:勘察(只读扫描)
import pandas as pd
FILE = 'target.xlsx' / FILE = '目标文件.xlsx'
KEY_COL = 'Column Name / 列名' # Key column name / 关键列名
KEEP = 'first' # 'first'=keep first occurrence / 保留首次 / 'last'=keep last / 保留末次
# pandas efficient read (C engine, seconds-level) / pandas 高效读取(C引擎,秒级)
df = pd.read_excel(FILE)
total = len(df)
mask = df[KEY_COL].duplicated(keep=KEEP)
dup_indices = df.index[mask].tolist()
dup_excel_rows = [i + 2 for i in dup_indices] # +2: pandas 0-index → Excel row number (row 1=header) / pandas 0-index → Excel行号(第1行=表头)
print(f'Total rows: {total} / 总行数: {total}')
print(f'Unique values: {total - len(dup_excel_rows)} / 唯一值: {total - len(dup_excel_rows)}')
print(f'Duplicate rows: {len(dup_excel_rows)} ({len(dup_excel_rows)/total*100:.1f}%) / 重复行: {len(dup_excel_rows)}')
print(f'Row range: {min(dup_excel_rows)} ~ {max(dup_excel_rows)}' if dup_excel_rows else 'No duplicates / 无重复')
Multi-Column Joint Dedup / 多列联合查重
KEY_COLS = ['Col1 / 列名1', 'Col2 / 列名2'] # Multi-column joint / 多列联合
mask = df.duplicated(subset=KEY_COLS, keep=KEEP)
Step 2: Output Results / 第二步:输出结果
if not dup_excel_rows:
print('✅ No duplicates / 无重复数据')
else:
print(f'\nDuplicate row number list (total {len(dup_excel_rows)} rows) / 重复行号列表(共{len(dup_excel_rows)}行):')
print(dup_excel_rows[:20]) # First 20 / 前20个
if len(dup_excel_rows) > 20:
print(f'... and {len(dup_excel_rows)-20} more rows / 还有{len(dup_excel_rows)-20}行')
# Pass to excel-delete for use / 传递给 excel-delete 使用
# Format: [row number list], sort descending then delete_rows one by one / 格式: [行号列表], 从大到小排序后逐个 delete_rows
Working with excel-delete / 与 excel-delete 配合
Find-duplicates output directly feeds into delete input: / 查重输出直接作为删除输入:
excel-find-duplicates → [2, 5, 8, 3, 12, ...] → excel-delete delete bottom-to-top / 从下到上删除
Delete-side code / 删除侧代码:
# Receive find-duplicates results / 接收查重结果
dup_rows = [2, 5, 8, 3, 12, ...] # From excel-find-duplicates / 来自 excel-find-duplicates
# Delete bottom-to-top (critical! avoids row number shifting) / 从下到上删除(关键!避免行号偏移)
for row in sorted(dup_rows, reverse=True):
ws.delete_rows(row)
Notes / 注意事项
- Read-only / 只读:Does not modify original file, safe to run / 不修改原文件,放心跑
- Row numbers are Excel row numbers / 行号是 Excel 行号:Row 1 = header, Row 2 = first data row / 第1行=表头,第2行=第一条数据
- Large files / 大文件:pandas reading 168MB/330K rows takes ~150s / pandas 读取 168MB/33万行约 150s
- Null values / 空值:Multiple rows with None in the key column are treated as "duplicates", only the first is kept / 关键列为 None 的多个行会被视为"重复",只保留第一个
当前收录版本
1.0.0
安全与评测信息
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- 提供 Excel 文件重复行扫描功能,具有广泛实用价值
- 支持单列和多列联合查重,适用场景灵活
亮点
- 触发词覆盖合理,边界清晰,能准确匹配用户意图
待提升项
-
description 写错位置 原报告严重程度:轻微
顶层 frontmatter 中 description 为空,实质描述内容在 skill_body 内部
改进建议:将 description 内容移至顶层 frontmatter 字段
-
缺少 When to Use 章节 原报告严重程度:轻微
文档结构缺少明确的 When to Use 使用场景说明章节
改进建议:增加 When to Use 章节说明典型使用场景
-
缺少端到端完整示例 原报告严重程度:轻微
示例代码片段分散,缺少一个完整的端到端执行示例
改进建议:增加一个完整的端到端示例展示从输入到输出的完整流程
亮点
- Phase/步骤清晰(Step 0/1/2),有出口条件
- frontmatter 完整,单文件未超500行
亮点
- 工具来源明确(pandas),参数正确
- 覆盖主要异常(空值处理、大文件提示),不可逆操作有确认机制(只读扫描)
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
| Element / 要素 | Common Phrasing / 常见表述 | Default / 默认值 | |------|---------|--------| | **Key Column(s) / 关键列** | "By patent number" / "Column E" / "按专利号查""E列" | Must be explicit / 必须明确 | | **Keep Strategy / 保留策略** | "Keep first" / "Keep latest" / "保留第一个""保留最新的" | Keep first occurrence / 保留首次出现 | | **Output Format / 输出格式** | Directly return row number list / 直接返回行号列表 | Excel row numbers / Excel 行号 |
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。