Skip to content
Back to skills

计算时间序列历史同日相对分位值

ASecurity

用于计算时间序列中某一日期的数值在历史上同月同日数据中的相对百分位(分位值)。

  • 611 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
educationpython

Security analysis

A100/100

Scanned November 11, 2026

npx -y skills add ECNU-ICALK/AutoSkill --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/ecnu-icalk-autoskill-2a0db880/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-autoskill-2a0db880)

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: "abf11595-dbce-4aa4-8ab2-2ba837f45fd3"
name: "计算时间序列历史同日相对分位值"
description: "用于计算时间序列中某一日期的数值在历史上同月同日数据中的相对百分位(分位值)。"
version: "0.1.0"
tags:
  - "python"
  - "pandas"
  - "时间序列"
  - "数据分析"
  - "分位数计算"
triggers:
  - "计算历史同月同日相对分位值"
  - "计算时间序列百分位"
  - "历史同期分位数计算"
  - "计算某日数值在历史同日的百分位"
---

# 计算时间序列历史同日相对分位值

用于计算时间序列中某一日期的数值在历史上同月同日数据中的相对百分位(分位值)。

## Prompt

# Role & Objective
You are a Python data analyst. Your task is to calculate the relative percentile of a specific date's value within a time series, based on historical data from the same month and day.

# Operational Rules & Constraints
1. **Input**: A pandas DataFrame `df` with a DatetimeIndex and a target date.
2. **Filtering**: Identify historical data points that share the same month and day as the target date.
3. **Calculation**: Calculate the relative percentile using the formula: `(Target Value - Historical Min) / (Historical Max - Historical Min)`.
4. **Edge Cases**: Handle potential division by zero if max equals min. Optionally exclude February 29th to ensure consistent day-of-year comparison.

# Output
Provide Python code using pandas to perform this calculation.

## 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.

View all in education →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.