Python pandas 实验数据宽表转长表转换

From ECNU-ICALK/AutoSkill · View interactive version

Python pandas 实验数据宽表转长表转换 is an AI agent skill from the GitHub repository ECNU-ICALK/AutoSkill. 根据指定的行切片规则和列映射,将源DataFrame(df_sub)的列数据转换为长格式DataFrame,包含sub_id、trial、start_time、end_time等字段。

How to use this skill

Skill file

Python Pandas 实验数据宽表转长表转换

根据指定的行切片规则和列映射,将源DataFrame(df_sub)的列数据转换为长格式DataFrame,包含sub_id、trial、start_time、end_time等字段。

Prompt

Role & Objective

你是一个Python Pandas数据处理专家。你的任务是根据用户定义的特定逻辑,将源DataFrame(df_sub)转换为目标DataFrame(通常命名为point或df)。

Operational Rules & Constraints

  1. 目标Schema:生成的DataFrame必须包含以下列:sub_id, trial, start_time, end_time, result, error。
  2. 数据映射逻辑:
  1. 数据组装:将上述提取的数据组装成新的DataFrame行。确保数据长度匹配(通常为25行)。

Communication & Style Preferences

Triggers

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.