Install any skill in seconds. Free to start, no credit card required.
Get Started Free →对多 Sheet 的 Excel 文件进行行数统计、大文件 Parquet 转换预处理、数据清洗及分组聚合分析,并生成带样式标记的统计表与可视化图表。
.claude/skills/opensensenova-group-by-analysis/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-11 | ✗→✓ | ▲ Improved | 24% | 0% |
| case-02 | ✗→✓ | ▲ Improved | -16% | 0% |
| case-15 | ✗→✓ | ▲ Improved | 31% | 0% |
| case-17 | ✗→✓ | ▲ Improved | 30% | 0% |
| case-10 | ✓→✗ | ▼ Worse | 72% | 0% |
Step1 对数据进行清洗与预处理,包括处理合并单元格、正则过滤以及分类映射。
pythonimport re # 1. 处理合并单元格:向前填充 target_col = 'category_column' df[target_col] = df[target_col].ffill() # 2. 正则清洗:去除无效字符或筛选特定格式 def clean_text(text): if pd.isna(text): return text return re.sub(r'[^\w\s]', '', str(text)).strip() df[target_col] = df[target_col].apply(clean_text) # 3. 分类映射函数骨架 def map_categories(value): mapping = { 'example_key_1': 'Group_A', 'example_key_2': 'Group_B' } return mapping.get(value, 'Others') df['group_tag'] = df[target_col].apply(map_categories)
Step2 执行分组统计,计算频数、占比,并添加总计行。
pythongroup_col = 'group_tag' value_col = 'value_column' # 分组聚合:计数与求和 summary = df.groupby(group_col)[value_col].agg(['count', 'sum']).reset_index() # 计算占比 total_sum = summary['sum'].sum() summary['percentage'] = (summary['sum'] / total_sum).map(lambda x: f"{x:.2%}") # 添加总计行 total_row = pd.DataFrame({ group_col: ['Total'], 'count': [summary['count'].sum()], 'sum': [total_sum], 'percentage': ['100.00%'] }) summary_final = pd.concat([summary, total_row], ignore_index=True) print(summary_final)
Step3 生成可视化柱状图,配置中文字体、数值标签及网格美化。
pythonimport matplotlib.pyplot as plt # 配置中文字体支持 plt.rcParams['font.sans-serif'] = ['SimHei', 'DejaVu Sans'] plt.rcParams['axes.unicode_minus'] = False plt.figure(figsize=(10, 6), dpi=100) bars = plt.bar(summary[group_col], summary['sum'], color='#4472C4') # 添加数值标签 for bar in bars: height = bar.get_height() plt.text(bar.get_x() + bar.get_width()/2., height, f'{height:,.0f}', ha='center', va='bottom', fontsize=10) plt.title("Distribution Analysis", fontsize=14) plt.xlabel(group_col) plt.ylabel("Values") plt.grid(axis='y', linestyle='--', alpha=0.7) plt.tight_layout() chart_path = "analysis_chart.png" plt.savefig(chart_path)
Step4 使用 openpyxl 生成带样式和条件格式的 Excel 报告,并提供下载。
pythonfrom openpyxl import Workbook from openpyxl.styles import PatternFill, Font, Alignment, Border, Side output_path = "analysis_report.xlsx" wb = Workbook() ws = wb.active ws.title = "Summary Report" # 定义样式 header_style = { "fill": PatternFill(start_color="4472C4", end_color="4472C4", fill_type="solid"), "font": Font(bold=True, color="FFFFFF"), "alignment": Alignment(horizontal="center"), "border": Border(left=Side(style="thin"), right=Side(style="thin"), top=Side(style="thin"), bottom=Side(style="thin")) } highlight_style = PatternFill(start_color="00B050", end_color="00B050", fill_type="solid") # 写入数据并应用样式 for r_idx, row in enumerate(summary_final.values, 2): for c_idx, value in enumerate(row, 1): cell = ws.cell(row=r_idx, column=c_idx, value=value) # 示例:对最大值所在行进行绿色标记 if value == summary['sum'].max(): cell.fill = highlight_style # 自动调整列宽 for col in ws.columns: max_length = max(len(str(cell.value)) for cell in col) ws.column_dimensions[col[0].column_letter].width = max_length + 2 wb.save(output_path) print(f"Download link: {output_path}")
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-11 | fail→pass | 9,768 | 7,385 | -24% | 1 | 1 | 0% | 2,063 | 2,555 | +24% | 0 | 0 | — |
case-10 | pass→fail | 9,177 | 10,658 | +16% | 1 | 1 | 0% | 1,886 | 3,249 | +72% | 0 | 0 | — |
case-01 | fail→fail | 29,398 | 21,969 | -25% | 1 | 1 | 0% | 6,210 | 4,738 | -24% | 0 | 0 | — |
case-02 | fail→pass | 29,988 | 18,605 | -38% | 1 | 1 | 0% | 6,205 | 5,201 | -16% | 0 | 0 | — |
case-03 | fail→fail | 8,743 | 3,464 | -60% | 1 | 1 | 0% | 1,682 | 1,724 | +2% | 0 | 0 | — |
case-04 | fail→fail | 13,256 | 11,891 | -10% | 1 | 1 | 0% | 1,831 | 2,890 | +58% | 0 | 0 | — |
case-05 | pass→pass | 7,915 | 6,530 | -17% | 1 | 1 | 0% | 1,523 | 2,120 | +39% | 0 | 0 | — |
case-06 | pass→pass | 7,808 | 5,164 | -34% | 1 | 1 | 0% | 1,607 | 2,086 | +30% | 0 | 0 | — |
case-07 | pass→pass | 10,430 | 6,812 | -35% | 1 | 1 | 0% | 1,870 | 2,467 | +32% | 0 | 0 | — |
case-08 | pass→pass | 9,083 | 8,702 | -4% | 1 | 1 | 0% | 1,753 | 3,102 | +77% | 0 | 0 | — |
case-09 | pass→pass | 9,981 | 13,005 | +30% | 1 | 1 | 0% | 1,898 | 3,109 | +64% | 0 | 0 | — |
case-12 | pass→pass | 16,927 | 6,412 | -62% | 1 | 1 | 0% | 2,749 | 2,557 | -7% | 0 | 0 | — |
case-13 | pass→pass | 10,899 | 10,043 | -8% | 1 | 1 | 0% | 2,218 | 3,059 | +38% | 0 | 0 | — |
case-14 | pass→pass | 9,610 | 7,510 | -22% | 1 | 1 | 0% | 1,850 | 2,189 | +18% | 0 | 0 | — |
case-15 | fail→pass | 18,441 | 18,699 | +1% | 1 | 1 | 0% | 3,924 | 5,130 | +31% | 0 | 0 | — |
case-16 | pass→pass | 10,366 | 11,435 | +10% | 1 | 1 | 0% | 2,054 | 3,343 | +63% | 0 | 0 | — |
case-17 | fail→pass | 6,768 | 3,769 | -44% | 1 | 1 | 0% | 1,411 | 1,829 | +30% | 0 | 0 | — |
case-18 | pass→pass | 7,952 | 6,361 | -20% | 1 | 1 | 0% | 1,601 | 2,344 | +46% | 0 | 0 | — |
case-19 | pass→pass | 6,968 | 3,580 | -49% | 1 | 1 | 0% | 1,338 | 1,782 | +33% | 0 | 0 | — |
case-20 | pass→pass | 9,279 | 3,775 | -59% | 1 | 1 | 0% | 1,541 | 1,849 | +20% | 0 | 0 | — |
case-21 | pass→pass | 13,097 | 15,038 | +15% | 1 | 1 | 0% | 2,789 | 3,656 | +31% | 0 | 0 | — |
case-22 | pass→pass | 9,750 | 6,515 | -33% | 1 | 1 | 0% | 1,481 | 2,417 | +63% | 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. 22 cases were attempted. The headline lift of +14 percentage points is the difference between those two pass rates over the 22 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
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.