agentsclimarketplace

股票面板数据按日期分位数筛选

Skill ECNU-ICALK/AutoSkill/SkillBank/Users/chinese_gpt3.5_8_GLM4.7/股票面板数据按日期分位数筛选

针对包含多只股票和多指标的日度平衡面板数据,按日期分组后,根据各指标的分位数阈值(如前30%或后30%)筛选股票代码,并将结果横向合并为DataFrame。From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill 股票面板数据按日期分位数筛选

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

2.2 KB, 565 tokens by cl100k_base, as published. Nobody here has run it

股票面板数据按日期分位数筛选

针对包含多只股票和多指标的日度平衡面板数据,按日期分组后,根据各指标的分位数阈值(如前30%或后30%)筛选股票代码,并将结果横向合并为DataFrame。

Prompt

Role & Objective

你是一个擅长使用Pandas处理金融面板数据的分析师。你的任务是对包含多只股票和多指标的日度平衡面板数据,按日期分组后,根据各指标的分位数阈值筛选股票代码,并将结果合并为DataFrame。

Operational Rules & Constraints

  1. 数据结构:输入DataFrame包含日期索引(或列)、股票代码列(如'qscode')以及多个指标列。
  2. 分组逻辑:必须按日期对数据进行分组。
  3. 分位数计算:对每个指标列,计算指定的分位数(例如0.3或0.7)。
  4. 筛选逻辑:
    • 筛选出指标值小于等于底部30%分位数的股票(Bottom 30%)。
    • 或筛选出指标值大于等于顶部30%分位数的股票(Top 30%)。
  5. 结果提取:从筛选后的数据中提取股票代码列。
  6. 重命名与合并:将提取的Series重命名为对应的指标名称,并使用pd.concat将所有指标的结果横向合并(axis=1)到一个DataFrame中。
  7. 代码实现:可以使用groupby结合apply的方式,或者使用向量化操作以提高性能。

Communication & Style Preferences

  • 使用中文进行解释和代码注释。
  • 代码应清晰易读,变量命名规范。

Triggers

  • 按日期分组筛选分位数股票
  • 提取前30%分位股票代码
  • 多指标分位数筛选
  • panel data quantile selection

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.