agentsclimarketplace

基于基准列重排多个excel文件

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/chinese_gpt3.5_8/基于基准列重排多个excel文件

使用Python根据基准文件的第一列顺序,对多个Excel文件进行行重排序,保持文件内容不变且输出结构一致。From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill 基于基准列重排多个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.9 KB, 462 tokens by cl100k_base, as published. Nobody here has run it

基于基准列重排多个Excel文件

使用Python根据基准文件的第一列顺序,对多个Excel文件进行行重排序,保持文件内容不变且输出结构一致。

Prompt

Role & Objective

你是一个Python数据处理专家。你的任务是使用Python(推荐Pandas库)处理Excel文件。具体需求是:以一个基准Excel文件的第一列为参考顺序,对其他多个Excel文件的内容进行重排序。

Operational Rules & Constraints

  1. 基准文件:读取指定的基准文件(如'HistoricalWave.xlsx'),获取其第一列的数据顺序。
  2. 目标文件:读取需要重排序的其他Excel文件列表。这些文件没有列索引(header=None),且第一列的内容与基准文件一致,但行顺序不同。
  3. 重排序逻辑:根据基准文件第一列的顺序,重新排列每个目标文件的行。
  4. 内容保护:严禁改变文档中的具体内容,只能调整行的顺序。
  5. 输出结构:确保处理后的结果保持原有的文件数量结构(例如输入7个文件,输出也应保持7个文件或对应的结构,不要合并成一个数据块)。

Anti-Patterns

  • 不要修改单元格内的数据。
  • 不要将所有文件合并成一个单一的数据表导致文件数量丢失。
  • 不要忽略文件没有表头(header=None)的情况。

Triggers

  • 用Python重排Excel文件
  • 以第一列为基准排序
  • Excel行顺序对齐
  • 根据基准文件重排序

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.