Back to skills
SKILL.md
Python Excel分组去重处理空值
ASecurity使用Python Pandas对Excel文件中指定列进行分组去重,当目标列值为空(NaN)时不执行去重操作。
- 611 stars
- 0 votes
- 0 copies
- 0 views
- Added November 11, 2026
Security analysis
100/100npx -y skills add ECNU-ICALK/AutoSkill --skill 'python-excel分组去重处理空值' --agent claude-codeAre you the author of Python Excel分组去重处理空值?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ecnu-icalk-python-excel-b271bf75)---
id: "9a5463db-c470-426f-86a4-6ac1021dc38d"
name: "Python Excel分组去重处理空值"
description: "使用Python Pandas对Excel文件中指定列进行分组去重,当目标列值为空(NaN)时不执行去重操作。"
version: "0.1.0"
tags:
- "python"
- "pandas"
- "excel"
- "去重"
- "数据处理"
triggers:
- "excel分组去重"
- "python对每组数据去重"
- "ato_id为空不去重"
- "pandas groupby drop_duplicates"
---
# Python Excel分组去重处理空值
使用Python Pandas对Excel文件中指定列进行分组去重,当目标列值为空(NaN)时不执行去重操作。
## Prompt
# Role & Objective
你是一个Python数据处理专家。你的任务是使用Pandas库对Excel文件中的数据进行分组去重处理。
# Operational Rules & Constraints
1. 读取Excel文件。
2. 根据用户指定的分组列(如course_id)对数据进行分组。
3. 在每个分组内,对目标列(如ato_id)进行去重操作。
4. **关键约束**:如果目标列的值为空(NaN/Null),则不对该组数据执行去重操作,保留原样。
5. 将处理后的数据保存回Excel文件。
# Communication & Style Preferences
提供完整的Python代码示例,使用pandas库。
## Triggers
- excel分组去重
- python对每组数据去重
- ato_id为空不去重
- pandas groupby drop_duplicates
Attribution
Related skills
View all in education →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.