
category-filtering-and-difficulty-analysis
对Excel数据进行自定义分类统计、交叉分析与可视化,并基于多维度指标(如文本长度、术语密度、正则匹配等)进行综合评分与分级,适用于多类别数据分布统计及文本内容难度/质量评估场景。
- Installs
- 0
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/opensensenova/sensenova-skills --skill category-filtering-and-difficulty-analysis- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads category-filtering-and-difficulty-analysis automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Skill Steps
Step1 加载数据与环境配置
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import re
# 配置中文字体,确保图表正常显示
plt.rcParams['font.sans-serif'] = ['SimHei', 'DejaVu Sans', 'WenQuanYi Zen Hei']
plt.rcParams['axes.unicode_minus'] = False
def load_excel_data(file_path: str, skip_rows: int = 2):
"""读取并加载Excel文件中的数据,跳过标题行以获取原始数据"""
# 技巧:处理合并单元格可使用 df.ffill() 等方法
df = pd.read_excel(file_path, skiprows=skip_rows)
return df
Step2 定义分类映射函数骨架
def categorize_data(item: str) -> str:
"""将具体项归类到大类中(分类映射函数骨架)"""
if pd.isna(item):
return '未知'
if item in ['类别A1', '类别A2', '类别A3']:
return '大类A'
elif item in ['类别B1', '类别B2']:
return '大类B'
else:
return '其他'
Step3 统一分析与可视化流程(柱状图、饼图、交叉分析)
def analyze_and_visualize(df: pd.DataFrame, category_col: str, group_col: str = None, output_path: str = './', top_n: int = None, custom_categorize=None):
"""统一分析与可视化流程:生成柱状图、饼图、交叉分析堆叠柱状图"""
df_clean = df.copy()
# 应用自定义分类规则
if custom_categorize:
df_clean[f'{category_col}大类'] = df_clean[category_col].apply(custom_categorize)
analyze_col = f'{category_col}大类'
else:
analyze_col = category_col
# value_counts + 占比统计
counts = df_clean[analyze_col].value_counts()
if top_n:
counts = counts.head(top_n)
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(15, 6))
# 柱状图美化
counts.plot(kind='bar', ax=ax1, color='skyblue', edgecolor='black')
ax1.set_title(f'{analyze_col}分布(柱状图)', fontsize=14, fontweight='bold')
ax1.set_xlabel(analyze_col, fontsize=12)
ax1.set_ylabel('数量', fontsize=12)
ax1.tick_params(axis='x', rotation=45)
ax1.grid(axis='y', alpha=0.3)
for i, v in enumerate(counts.values):
ax1.text(i, v + 0.05, str(v), ha='center', va='bottom', fontweight='bold')
# 饼图美化
colors = plt.cm.Set3(np.linspace(0, 1, len(counts)))
wedges, texts, autotexts = ax2.pie(counts.values, labels=counts.index, autopct='%1.1f%%', colors=colors, startangle=90)
ax2.set_title(f'{analyze_col}分布(饼图)', fontsize=14, fontweight='bold')
for text in texts:
text.set_fontsize(10)
for autotext in autotexts:
autotext.set_fontsize(9)
autotext.set_fontweight('bold')
plt.tight_layout()
plt.savefig(f'{output_path}{analyze_col}_分布图.png', dpi=300, bbox_inches='tight')
plt.close()
# 交叉分析 (crosstab)
if group_col and group_col in df_clean.columns:
cross_table = pd.crosstab(df_clean[group_col], df_clean[analyze_col])
if top_n:
cross_table = cross_table.head(top_n)
plt.figure(figsize=(10, 6))
cross_table.plot(kind='bar', stacked=True, colormap='viridis')
plt.title(f'各{group_col}的{analyze_col}分布', fontsize=14, fontweight='bold')
plt.xlabel(group_col, fontsize=12)
plt.ylabel('数量', fontsize=12)
plt.xticks(rotation=45)
plt.legend(title=analyze_col, bbox_to_anchor=(1.05, 1), loc='upper left')
plt.grid(axis='y', alpha=0.3)
plt.tight_layout()
plt.savefig(f'{output_path}交叉分析图.png', dpi=300, bbox_inches='tight')
plt.close()
Step4 多维度评分与分级算法结构
def analyze_content_difficulty(content: str) -> tuple:
"""多维度评分/分级算法结构:基于长度、术语、正则匹配等计算综合评分"""
if not isinstance(content, str):
return 0, '低'
length = len(content)
# 关键词匹配
technical_terms = ['专业术语A', '专业术语B', '核心概念C']
tech_count = sum(1 for term in technical_terms if term in content)
# 数据清洗与正则匹配(如提取数值要求)
has_numeric = bool(re.search(r'\d+', content))
complex_concepts = ['复杂流程X', '高阶操作Y']
complex_count = sum(1 for concept in complex_concepts if concept in content)
# 综合评分计算公式
score = (length / 100) * 30 + (tech_count / 10) * 20 + (1 if has_numeric else 0) * 15 + (complex_count / 5) * 35
# 难度/质量分级标准
if score >= 70:
level = '高'
elif score >= 40:
level = '中'
else:
level = '低'
return score, level
Step5 生成综合评分分析图表
def generate_comprehensive_analysis(df: pd.DataFrame, content_col: str, output_path: str = './'):
"""为目标内容生成综合评分分析图表(横向条形图、趋势图)"""
# 过滤空值并重置索引
target_data = df.dropna(subset=[content_col]).reset_index(drop=True)
scores, levels = zip(*target_data[content_col].apply(analyze_content_difficulty))
target_data['综合评分'] = scores
target_data['评级'] = levels
# 评级分布(横向条形图)
level_counts = target_data['评级'].value_counts()
plt.figure(figsize=(10, 6))
bars = plt.barh(level_counts.index, level_counts.values, color='skyblue', edgecolor='black')
plt.title('各评级数量分布(横向条形图)', fontsize=14, fontweight='bold')
plt.xlabel('数量', fontsize=12)
plt.ylabel('评级', fontsize=12)
for bar, count in zip(bars, level_counts.values):
plt.text(bar.get_width() + 0.1, bar.get_y() + bar.get_height()/2, str(count), va='center', fontsize=10)
plt.grid(axis='x', alpha=0.3)
plt.tight_layout()
plt.savefig(f'{output_path}评级分布_横向条形图.png', dpi=300, bbox_inches='tight')
plt.close()
# 长度与评分趋势图(散点图)
plt.figure(figsize=(10, 6))
plt.scatter(target_data[content_col].str.len(), scores, alpha=0.6, color='green')
plt.title('内容长度与综合评分趋势图', fontsize=14, fontweight='bold')
plt.xlabel('内容长度(字符数)', fontsize=12)
plt.ylabel('综合评分', fontsize=12)
plt.grid(True, alpha=0.3)
plt.tight_layout()
plt.savefig(f'{output_path}长度与评分趋势图.png', dpi=300, bbox_inches='tight')
plt.close()
return target_data
Step6 执行完整分析流程
if __name__ == '__main__':
file_path = 'input_data.xlsx'
output_path = './output/'
# 1. 加载数据
df = load_excel_data(file_path, skip_rows=2)
# 2. 分类统计与交叉分析
analyze_and_visualize(
df,
category_col='目标列A',
group_col='分组列B',
output_path=output_path,
custom_categorize=categorize_data
)
# 3. 文本内容多维度评分与可视化
content_col = '文本内容列'
if content_col in df.columns:
processed_df = generate_comprehensive_analysis(df, content_col=content_col, output_path=output_path)
FAQ
What does the category-filtering-and-difficulty-analysis skill do?
对Excel数据进行自定义分类统计、交叉分析与可视化,并基于多维度指标(如文本长度、术语密度、正则匹配等)进行综合评分与分级,适用于多类别数据分布统计及文本内容难度/质量评估场景。
How do I install category-filtering-and-difficulty-analysis?
Run npx skills add https://github.com/opensensenova/sensenova-skills --skill category-filtering-and-difficulty-analysis in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/category-filtering-and-difficulty-analysis/ (personal) or .claude/skills/category-filtering-and-difficulty-analysis/ (project).
Which AI agents can use category-filtering-and-difficulty-analysis?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is category-filtering-and-difficulty-analysis safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains category-filtering-and-difficulty-analysis?
It is published by opensensenova in opensensenova/sensenova-skills. It has 0 recorded installs.
More from opensensenova/sensenova-skills
sn-image-base
opensensenova/sensenova-skills
Base-layer skill for the SenseNova-Skills project, providing low-level APIs for image generation, recognition (VLM), and text optimization (LLM). This skill does not preprocess inputs; it only calls backend services and returns results. This skill is not user-facing and is intended for upper-layer skills only.
sn-infographic
opensensenova/sensenova-skills
Generates professional infographics with various layout types and visual styles. Analyzes content, recommends layout and style, and generates publication-ready infographics. Use when user asks to create "infographic", "信息图", "visual summary", or "可视化".
sn-ppt-standard
opensensenova/sensenova-skills
仅在 sn-ppt-entry 与 sn-ppt-story 已准备绝对 DECKDIR 和 outline.md 后使用;生成每页独立 HTML(1600×900)、渲染 PNG、逐页讲稿、present.html,并按 staticpostprocess 选择生成由 Standard 自有 exporter 转换的 PPTX。present.html 始终是必交付产物,缺失即技术故障,不得交付;staticpostprocess 含 pptx 时 PPTX 同为必交付产物(缺一即技术故障),且只能由 Standard 自有 exporter 生成;仅当用户明确要求只要 HTML(staticpostprocess 为 [])时,PPTX 才可不交付。
sn-md-to-html-report
opensensenova/sensenova-skills
将 Markdown 报告、研究笔记、行业分析、战略备忘录、技术白皮书、复盘、周报等长文档,重组并创作为有编辑判断、网页美感和证据秩序的自包含 HTML 专题页。用户要求“转成 HTML”“网页化报告”“美化报告”“做成专题页”“便于分享”“提升可读性/设计感”“把报告做成网页”时使用。必须先写 plan.md 再写 HTML,保留原文事实断言和结论强度,不套模板,不做机械 Markdown 转换。
sn-ppt-entry
opensensenova/sensenova-skills
Use when a user asks to create a presentation, slide deck, PPT, or PPTX from a query and optional files, or to resume an existing SenseNova presentation task.
sn-image-resume
opensensenova/sensenova-skills
Generates a designed portfolio-resume image from resume content provided in conversation text. Extracts optional style instructions, converts the resume into a fixed portfolio-resume layout prompt, and generates the final image through sn-image-base. Use when user asks to create "resume image", "portfolio resume", "简历图", "简历海报", or "个人简历视觉设计".
Popular data & databases skills
supabase-postgres-best-practices
supabase/agent-skills
Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pgcron, pgmq), vector/semantic search (pgvector), and restoring dumps (pgrestore) or importing data. Also load it when diagnosing slow queries, high CPU, timeouts, EXPLAIN plans, connection exhaustion, locking, bloat, or rows visible to the wrong user or tenant. This is not just a performance guide — schema, migration, security, and SQL authoring tasks need these rules too, even for a one-column change or a single query.
prisma-client-api
prisma/skills
Prisma Client API reference covering model queries, filters, operators, and client methods. Use when writing database queries, using CRUD operations, filtering data, or configuring Prisma Client. Triggers on "prisma query", "findMany", "create", "update", "delete", "$transaction".
prisma-database-setup
prisma/skills
Deprecated compatibility name for prisma-orm-setup. Use only when a user or existing integration explicitly invokes prisma-database-setup; otherwise select prisma-orm-setup.
prisma-cli
prisma/skills
Prisma ORM 7 CLI reference for existing Prisma 7 applications or explicitly selected Prisma 7 workflows. Covers prisma init, generate, migrate, db, dev, studio, and mcp. For setup, connection repair, or Prisma 8, use prisma-orm-setup; not the Prisma Platform CLI.
prisma-postgres
prisma/skills
Deprecated compatibility name for prisma-postgres-setup. Use only when a user or existing integration explicitly invokes prisma-postgres; otherwise select prisma-postgres-setup.
prisma-postgres-setup
prisma/skills
Obtain or reuse a Prisma Postgres database and connect an application. Use when the user needs a database and has none configured ("I need a database", "add a Postgres database", "set up a database for this app"), runs or mentions create-db or npx create-db, or asks to set up or connect Prisma Postgres, including in v0 and the Vercel Marketplace. Hands Prisma ORM configuration to prisma-orm-setup; reuses an existing connection first and honors an explicit provider, driver, alternative ORM, or database-only choice.