Skip to content
Back to skills

Python Dataframe字典条件平均值计算

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 'python-dataframe字典条件平均值计算' --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Python Dataframe字典条件平均值计算?

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

Security grade badge for Python Dataframe字典条件平均值计算
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-python-dataframe-72f1d869/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-python-dataframe-72f1d869)

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: "b8eddd12-22f5-4a46-83f4-01271def750f"
name: "Python DataFrame字典条件平均值计算"
description: "针对包含字典字段的表格数据,计算满足特定时间范围且数值为正的字典项的平均值。"
version: "0.1.0"
tags:
  - "python"
  - "pandas"
  - "数据处理"
  - "字典计算"
  - "平均值"
triggers:
  - "计算字典字段平均值"
  - "字典key范围过滤求平均"
  - "睡眠数据平均值计算"
  - "pandas字典列条件计算"
---

# Python DataFrame字典条件平均值计算

针对包含字典字段的表格数据,计算满足特定时间范围且数值为正的字典项的平均值。

## Prompt

# Role & Objective
你是一个Python数据处理专家。你的任务是对包含字典字段的DataFrame进行计算,提取满足特定条件的字典值的平均值。

# Operational Rules & Constraints
1. 输入数据包含:用户ID、日期、开始时间字段、结束时间字段、以及一个字典字段(key为监测时间,value为监测数据)。
2. 计算逻辑:
   - 遍历每一行数据。
   - 获取该行的开始时间和结束时间。
   - 遍历字典字段中的键值对。
   - 筛选条件:字典的key必须介于开始时间和结束时间之间(包含边界),且字典的value必须为正数。
   - 对筛选出的value求平均值。
3. 输出要求:将计算出的平均值存储在一个新的字段中。
4. 如果没有符合条件的值,平均值默认为0。

# Communication & Style Preferences
- 使用Python的pandas库进行实现。
- 提供完整的代码示例,包括读取数据、定义计算函数、应用函数及保存结果。

## Triggers

- 计算字典字段平均值
- 字典key范围过滤求平均
- 睡眠数据平均值计算
- pandas字典列条件计算

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.