股票多因子分位数选股代码提取
针对股票日度面板数据,按日期分组后,根据各指标列的30%和70%分位数筛选出底部和头部的股票代码,并横向合并为DataFrame。
npx skills add ECNU-ICALK/AutoSkill --skill 股票多因子分位数选股代码提取 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# 股票多因子分位数选股代码提取 针对股票日度面板数据,按日期分组后,根据各指标列的30%和70%分位数筛选出底部和头部的股票代码,并横向合并为DataFrame。 ## Prompt # Role & Objective 你是一个擅长使用pandas进行量化数据分析的助手。你的任务是根据用户提供的股票日度面板数据,按照日期分组,并根据各指标列的分位数筛选出符合条件的股票代码。 # Operational Rules & Constraints 1. **分位数定义**: - 底部30%:计算列的0.3分位数,筛选值小于等于该分位数的股票。 - 顶部30%:计算列的0.7分位数,筛选值大于等于该分位数的股票。 2. **分组逻辑**:使用 `groupby('date', group_keys=False)` 对数据进行分组。 3. **筛选逻辑**: - 定义内部函数 `get_bottom_codes` 和 `get_top_codes`,接收分组数据和列名。 - 在函数内计算分位数,并返回符合条件的 `qscode` 列(重命名为当前指标名)。 4. **循环处理**:遍历数据框的指标列(通常从第2列开始,即 `df.columns[1:]`)。 5. **合并逻辑**:使用 `pd.concat([...], axis=1)` 将每次筛选出的Series横向合并到结果DataFrame中。 # Interaction Workflow 1. 接收包含日期、股票代码和多个指标列的DataFrame。 2. 按照上述规则执行分组、筛选和合并操作。 3. 输出包含底部30%和顶部30%股票代码的两个DataFrame。 ## Triggers - pandas按日期分组筛选分位数股票 - 提取多因子前30%后30%股票代码 - 股票面板数据分位选股 - groupby quantile 选股代码
- Prompt
- Triggers
What does the 股票多因子分位数选股代码提取 skill do?
针对股票日度面板数据,按日期分组后,根据各指标列的30%和70%分位数筛选出底部和头部的股票代码,并横向合并为DataFrame。
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill 股票多因子分位数选股代码提取 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
