category-statistics SKILL.md skillA
category-statistics from opensensenova/sensenova-skills is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.
mdr add opensensenova/sensenova-skills/category-statistics@git:20260426.f0ab496Pins git:20260426.f0ab496 in mdr.lock. Pin the fingerprint instead.
- Audit grade
- A, 17 of 17 checks passed
- Kind
- SKILL.md skill
- Repository
- opensensenova/sensenova-skills
- Path
skills/sn-da-excel-workflow/capability/excel-data-statistics/category-statistics/SKILL.md- Versions recorded
- 1
- Latest version
- git:20260426.f0ab496, committed Apr 26, 2026
- Size
- 5,610 bytes
- Repository stars
- 6,031
- License
- MIT
提取指定类别列并统计各类别数量与占比,生成高分辨率的柱状图、饼图等组合可视化报告,适用于分类数据的分布情况分析。.
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
## Skill Steps
Step1 提取目标类别数据,清洗无效标签,并统计各类别数量与占比。
```python
import pandas as pd
def calculate_distribution(data, target_col='类别'):
# 检查目标列是否存在
if target_col not in data.columns:
raise ValueError(f'未找到指定的类别字段: {target_col}')
# 提取数据,清洗无效标签(如'--'、'代码'等占位符)
category_data = data[target_col].dropna().replace(['--', '代码'], pd.NA).dropna()
# 统计各类别数量并计算占比
counts = category_data.value_counts()
proportions = (counts / counts.sum()) * 100
# 实用技巧:生成包含总计行的统计表
# summary = counts.copy()
# summary.loc['总计'] = counts.sum()
return counts, proportions
```
Step2 生成基础可视化(双轴图:柱状图+占比曲线),并保存为高分辨率图片。
```python
import matplotlib.pyplot as plt
def generate_and_save_basic_chart(counts, proportions, title='各类别数量分布', output_path='category_distribution.png'):
# 设置中文字体避免乱码
plt.rcParams['font.sans-serif'] = ['SimHei', 'WenQuanYi Zen Hei', 'Noto Sans CJK JP', 'DejaVu Sans']
plt.rcParams['axes.unicode_minus'] = False
fig, ax1 = plt.subplots(figsize=(10, 6))
# 绘制柱状图
bars = ax1.bar(counts.index, counts.values, color='skyblue', edgecolor='black')
for bar in bars:
height = bar.get_height()
…Read the whole file at its exact version.
How to install
mdr add opensensenova/sensenova-skills/category-statistics@sha256:3fae4ce41aa0af6aThe line at the top of this page pins the label git:20260426.f0ab496, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
[](https://markdownregistry.com/a/art_bnjtt2k4duyc5jwq)
4 badge image fetches in 30 days. What the badge shows.
Versions
The registry has recorded 1 version of this file, committed on Apr 26, 2026.
Audit of the latest version
- pass: Frontmatter block present
- pass: Frontmatter declares a name
- pass: Frontmatter declares a description
- pass: Size between 200 bytes and 200 KB (5610 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
opensensenova/sensenova-skills · 6,031 stars · license MIT · pushed 2026-11-03 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_bnjtt2k4duyc5jwq GET https://markdownregistry.com/api/v1/resolve?ref=opensensenova/sensenova-skills/category-statistics GET https://markdownregistry.com/api/v1/blob/3fae4ce41aa0af6ab0c71e4be6399fcbea14459c784138789eb60be4a38f5562
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.