Install any skill in seconds. Free to start, no credit card required.
Get Started Free →读取并解析单个Excel工作表数据,支持合并单元格处理、数据清洗、交叉分析及多维度可视化,适用于需要从单表中提取关键指标并进行趋势模拟与图表生成的场景。
.claude/skills/opensensenova-single-sheet-reading-and-analysis/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 23% | 0% |
| case-02 | ✗→✓ | ▲ Improved | -7% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 66% | 0% |
| case-13 | ✓→✓ | = Same ✓ | 77% | 0% |
| case-06 | ✓→✓ | = Same ✓ | 92% | 0% |
Step1 导入依赖并配置中英文字体,防止图表乱码
pythonimport pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import re import base64 from IPython.display import HTML # 设置中英文字体 plt.rcParams['font.sans-serif'] = ['SimHei', 'DejaVu Sans', 'WenQuanYi Zen Hei'] plt.rcParams['axes.unicode_minus'] = False
Step2 加载数据与基础清洗,包含合并单元格处理与正则提取
pythondef load_and_clean_data(file_path, sheet_name=0): # 读取数据 df = pd.read_excel(file_path, sheet_name=sheet_name) # 处理合并单元格:向前填充并还原 # df['group_col'] = df['group_col'].ffill() # 标准化列名:去除首尾空格及换行符 df.columns = [str(col).strip().replace('\n', '') for col in df.columns] # 数据清洗正则表达式示例:提取数值 if 'target_col' in df.columns: df['target_col'] = df['target_col'].astype(str).apply(lambda x: re.sub(r'[^\d.]', '', x)) df['target_col'] = pd.to_numeric(df['target_col'], errors='coerce') # 处理全空行缺失值 df = df.dropna(how='all') return df
Step3 数据分类映射与多维度评分/分级算法
pythondef categorize_and_score(df, target_col): # 分类映射函数骨架 def map_category(val): if pd.isna(val): return '未知' elif val > 100: # 占位示例:高阈值 return 'A类' elif val > 50: # 占位示例:中阈值 return 'B类' else: return 'C类' if target_col in df.columns: df['category'] = df[target_col].apply(map_category) # 多维度评分/分级算法结构 # df['score'] = df['metric1'] * 0.4 + df['metric2'] * 0.6 return df
Step4 交叉分析与统计汇总(频数、占比、总计行)
pythondef analyze_data(df, group_col): # value_counts + 占比 + 总计行 counts = df[group_col].value_counts().reset_index() counts.columns = [group_col, '数量'] counts['占比'] = (counts['数量'] / counts['数量'].sum()).map('{:.2%}'.format) # 添加总计行 total_row = pd.DataFrame({ group_col: ['总计'], '数量': [counts['数量'].sum()], '占比': ['100.00%'] }) counts = pd.concat([counts, total_row], ignore_index=True) # 交叉分析 crosstab/pivot if 'category' in df.columns: cross_tb = pd.crosstab(df[group_col], df['category'], margins=True, margins_name='总计') else: cross_tb = None return counts, cross_tb
Step5 图表美化与高分辨率输出
pythondef visualize_results(df, group_col, target_col, output_path): # 设置高分辨率 dpi=300 fig, ax = plt.subplots(figsize=(10, 6), dpi=300) # 颜色方案与图表绘制 valid_data = df.dropna(subset=[group_col, target_col]) colors = sns.color_palette("husl", len(valid_data[group_col].unique())) sns.barplot(data=valid_data, x=group_col, y=target_col, palette=colors, ax=ax) # 标签位置与美化 ax.set_title('多维度数据分析', fontsize=16, pad=15) ax.set_xlabel('分组维度', fontsize=12) ax.set_ylabel('目标指标', fontsize=12) plt.xticks(rotation=45, ha='right') # 添加数据标签 for p in ax.patches: ax.annotate(f'{p.get_height():.1f}', (p.get_x() + p.get_width() / 2., p.get_height()), ha='center', va='bottom', fontsize=10) plt.tight_layout() plt.savefig(output_path, dpi=300, bbox_inches='tight') plt.close()
Step6 大文件 Parquet 转换与下载链接生成
pythondef export_and_generate_link(df, output_path): # 大文件 Parquet 转换 parquet_path = output_path.replace('.png', '.parquet').replace('.csv', '.parquet') df.to_parquet(parquet_path, index=False) # 下载链接生成 csv_data = df.to_csv(index=False).encode('utf-8') b64 = base64.b64encode(csv_data).decode() href = f'<a href="data:file/csv;base64,{b64}" download="analysis_result.csv">点击下载分析结果 (CSV)</a>' display(HTML(href))
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-13 | pass→pass | 8,616 | 8,476 | -2% | 1 | 1 | 0% | 1,769 | 3,138 | +77% | 0 | 0 | — |
case-01 | fail→pass | 20,480 | 12,215 | -40% | 1 | 1 | 0% | 3,541 | 4,352 | +23% | 0 | 0 | — |
case-02 | fail→pass | 19,490 | 13,716 | -30% | 1 | 1 | 0% | 4,177 | 3,877 | -7% | 0 | 0 | — |
case-03 | fail→fail | 14,959 | 12,778 | -15% | 1 | 1 | 0% | 2,254 | 3,869 | +72% | 0 | 0 | — |
case-04 | fail→fail | 11,406 | 5,912 | -48% | 1 | 1 | 0% | 1,633 | 2,525 | +55% | 0 | 0 | — |
case-05 | fail→fail | 8,829 | 5,839 | -34% | 1 | 1 | 0% | 1,659 | 2,560 | +54% | 0 | 0 | — |
case-06 | pass→pass | 6,759 | 6,466 | -4% | 1 | 1 | 0% | 1,340 | 2,573 | +92% | 0 | 0 | — |
case-07 | pass→pass | 11,407 | 6,555 | -43% | 1 | 1 | 0% | 1,758 | 2,785 | +58% | 0 | 0 | — |
case-08 | pass→pass | 10,436 | 5,407 | -48% | 1 | 1 | 0% | 1,690 | 2,466 | +46% | 0 | 0 | — |
case-09 | pass→pass | 9,147 | 5,524 | -40% | 1 | 1 | 0% | 1,911 | 2,435 | +27% | 0 | 0 | — |
case-10 | pass→pass | 4,465 | 3,582 | -20% | 1 | 1 | 0% | 974 | 2,048 | +110% | 0 | 0 | — |
case-11 | pass→pass | 12,992 | 10,558 | -19% | 1 | 1 | 0% | 2,410 | 3,505 | +45% | 0 | 0 | — |
case-12 | fail→pass | 10,453 | 11,563 | +11% | 1 | 1 | 0% | 2,109 | 3,491 | +66% | 0 | 0 | — |
case-14 | pass→pass | 6,447 | 6,232 | -3% | 1 | 1 | 0% | 1,240 | 2,180 | +76% | 0 | 0 | — |
case-15 | pass→pass | 5,700 | 4,610 | -19% | 1 | 1 | 0% | 1,194 | 2,233 | +87% | 0 | 0 | — |
case-16 | pass→pass | 8,618 | 5,734 | -33% | 1 | 1 | 0% | 1,779 | 2,594 | +46% | 0 | 0 | — |
case-17 | pass→pass | 4,963 | 3,816 | -23% | 1 | 1 | 0% | 794 | 2,014 | +154% | 0 | 0 | — |
case-18 | pass→pass | 5,962 | 4,258 | -29% | 1 | 1 | 0% | 890 | 2,238 | +151% | 0 | 0 | — |
case-19 | pass→pass | 5,307 | 3,324 | -37% | 1 | 1 | 0% | 974 | 1,987 | +104% | 0 | 0 | — |
case-20 | pass→pass | 5,543 | 3,601 | -35% | 1 | 1 | 0% | 937 | 2,005 | +114% | 0 | 0 | — |
case-21 | pass→pass | 3,923 | 5,274 | +34% | 1 | 1 | 0% | 740 | 2,158 | +192% | 0 | 0 | — |
case-22 | pass→pass | 8,074 | 7,471 | -7% | 1 | 1 | 0% | 1,826 | 2,518 | +38% | 0 | 0 | — |
case-23 | pass→pass | 10,686 | 7,027 | -34% | 1 | 1 | 0% | 2,412 | 2,884 | +20% | 0 | 0 | — |
case-24 | pass→pass | 9,647 | 19,377 | +101% | 1 | 1 | 0% | 2,047 | 4,657 | +128% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 24 cases were attempted. The headline lift of +13 percentage points is the difference between those two pass rates over the 24 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.