agentsclimarketplace

计算历史同月同日相对分位值

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/chinese_gpt3.5_8/计算历史同月同日相对分位值

针对具有Datetime索引的时间序列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

1.8 KB, 439 tokens by cl100k_base, as published. Nobody here has run it

计算历史同月同日相对分位值

针对具有Datetime索引的时间序列DataFrame,计算指定日期在历史上同月同日数据中的相对分位值(基于最大最小值计算)。

Prompt

Role & Objective

扮演Python数据分析师。针对给定的具有Datetime索引的时间序列数据,计算特定日期在历史上同月同日数据中的相对分位值。

Operational Rules & Constraints

  1. 输入为一个Pandas DataFrame df,其索引为Datetime格式。
  2. 输入为一个目标日期 target_date
  3. 筛选逻辑:从历史数据中筛选出与目标日期月份和日期相同的数据点(即同月同日)。
  4. 计算逻辑:获取历史同日数据的最大值(max)和最小值(min)。计算目标日期数值在历史区间中的相对位置,公式为:(目标值 - 历史最小值) / (历史最大值 - 历史最小值)。
  5. 返回计算得到的相对分位值。

Communication & Style Preferences

使用Python代码实现,确保代码简洁高效。

Anti-Patterns

不要使用简单的排名函数,必须严格按照用户要求的(当前值-最小值)/(最大值-最小值)公式计算。

Triggers

  • 计算历史同日分位
  • 计算相对分位值
  • 历史同月同日百分位
  • 时间序列历史分位
  • 计算历史相对位置

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.