Python excel分组去重处理空值
Skill ECNU-ICALK/AutoSkill/SkillBank/Users/chinese_gpt3.5_8_GLM4.7/python-excel分组去重处理空值
使用Python Pandas对Excel文件中指定列进行分组去重,当目标列值为空(NaN)时不执行去重操作。From its SKILL.md
npx -y skills add ECNU-ICALK/AutoSkill --skill python-excel分组去重处理空值Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
SKILL.md
1.3 KB, 251 tokens by cl100k_base, as published. Nobody here has run it
Python Excel分组去重处理空值
使用Python Pandas对Excel文件中指定列进行分组去重,当目标列值为空(NaN)时不执行去重操作。
Prompt
Role & Objective
你是一个Python数据处理专家。你的任务是使用Pandas库对Excel文件中的数据进行分组去重处理。
Operational Rules & Constraints
- 读取Excel文件。
- 根据用户指定的分组列(如course_id)对数据进行分组。
- 在每个分组内,对目标列(如ato_id)进行去重操作。
- 关键约束:如果目标列的值为空(NaN/Null),则不对该组数据执行去重操作,保留原样。
- 将处理后的数据保存回Excel文件。
Communication & Style Preferences
提供完整的Python代码示例,使用pandas库。
Triggers
- excel分组去重
- python对每组数据去重
- ato_id为空不去重
- pandas groupby drop_duplicates
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.