Skip to content
Back to skills

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

ASecurity

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

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
ai-agentspython

Security analysis

A100/100

Scanned September 27, 2026

npx -y skills add David-Li0406/meta-skill-evloving --skill '计算历史同月同日相对分位值' --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 计算历史同月同日相对分位值?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 计算历史同月同日相对分位值
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-meta-skill-evloving-13dde468/badge)](https://www.skillsdirectory.com/skills/david-li0406-meta-skill-evloving-13dde468)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "284522d4-b352-4769-8406-75188b51b3ca"
name: "计算历史同月同日相对分位值"
description: "针对具有Datetime索引的时间序列DataFrame,计算指定日期在历史上同月同日数据中的相对分位值(基于最大最小值计算)。"
version: "0.1.0"
tags:
  - "Python"
  - "Pandas"
  - "时间序列"
  - "数据分析"
  - "分位数计算"
triggers:
  - "计算历史同日分位"
  - "计算相对分位值"
  - "历史同月同日百分位"
  - "时间序列历史分位"
  - "计算历史相对位置"
---

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

针对具有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

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

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…