agentsclimarketplace

Python excel分组去重处理空值

Skill ECNU-ICALK/AutoSkill/SkillBank/Users/chinese_gpt3.5_8_GLM4.7/python-excel分组去重处理空值

使用Python Pandas对Excel文件中指定列进行分组去重,当目标列值为空(NaN)时不执行去重操作。From its SKILL.md

Install
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

  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

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.