pivot-table-cross-analysis SKILL.md skillA
pivot-table-cross-analysis 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/pivot-table-cross-analysis@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-analysis/pivot-table-analysis/SKILL.md- Versions recorded
- 1
- Latest version
- git:20260426.f0ab496, committed Apr 26, 2026
- Size
- 4,540 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
Step1 对原始数据进行清洗与重构,处理 Excel 合并单元格导致的缺失值,并筛选核心分析列。
```python
import pandas as pd
def preprocess_pivot_data(file_path, target_cols=['奖项', '项目名称', '成员', '单位']):
"""
清理并重构数据列,处理合并单元格填充。
"""
df = pd.read_excel(file_path)
# 映射通用列名
df.columns = target_cols
# 关键技巧:处理合并单元格。ffill 前需确保数据按原始分类顺序排列
# 假设第一列为分类标签(如奖项名称)
df[target_cols[0]] = df[target_cols[0]].fillna(method='ffill')
# 删除关键信息(如成员或单位)缺失的无效行
df = df.dropna(subset=[target_cols[2], target_cols[3]])
# 清洗字符串空格
for col in df.select_dtypes(['object']).columns:
df[col] = df[col].str.strip()
return df
```
Step2 构建交叉分析表(Crosstab),计算不同维度下的频数分布及百分比占比。
```python
def create_cross_analysis(df, index_col='单位', columns_col='奖项'):
"""
构建交叉表并计算各分类维度的获奖/分布比例。
"""
# 生成频数统计交叉表
cross_table = pd.crosstab(df[index_col], df[columns_col])
# 计算占比:各列(奖项)下各行(单位)的分布比例
# div(axis=1) 表示按列求和后进行除法
award_proportions = cross_table.div(cross_table.sum(axis=0), axis=1) * 100
# 技巧:生成带有总计行和占比的汇总表
summary = cross_table.copy()
summary['总计'] = summary.sum(axis=1)
summary.loc['合计'] = summary.sum()
…Read the whole file at its exact version.
How to install
mdr add opensensenova/sensenova-skills/pivot-table-cross-analysis@sha256:8af963f7cf600f92The 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_ujfartmkzjabvhed)
5 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 (4540 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_ujfartmkzjabvhed GET https://markdownregistry.com/api/v1/resolve?ref=opensensenova/sensenova-skills/pivot-table-cross-analysis GET https://markdownregistry.com/api/v1/blob/8af963f7cf600f9249d98eb77ae246ae64079f3cfcc2b094d1b4ab193d46673d
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.