Install any skill in seconds. Free to start, no credit card required.
Get Started Free →对多 Sheet 的 Excel 文件进行行数统计、数据合并与前向填充。
.claude/skills/opensensenova-grouped-statistics/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -8% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 34% | 0% |
| case-11 | ✗→✓ | ▲ Improved | -2% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 21% | 0% |
| case-17 | ✗→✓ | ▲ Improved | 26% | 0% |
> Note: This sub-skill covers one step of the Excel analysis workflow. For the full pipeline (file reading, row counting, large-file optimization, export), see the parent workflow SKILL.md.
Step1 提取关键维度与指标信息,处理合并单元格缺失值,并进行多表交叉分析与排序。
pythonimport pandas as pd # 设定目标列名 group_col = '行业名称' target_val_1 = '企业单位数' target_val_2 = '工业总产值' # 读取第一个 Sheet 并清洗 df1 = pd.read_excel(file_path, sheet_name=sheet_names[0], header=None) # 假设数据从第 21 行开始,提取维度列与数值列 data_1 = df1.iloc[21:63, [0, 2]].copy() data_1.columns = [group_col, target_val_1] # 处理合并单元格:前向填充维度列 data_1[group_col] = data_1[group_col].ffill() data_1[target_val_1] = pd.to_numeric(data_1[target_val_1], errors='coerce') # 读取第二个 Sheet 并提取补充指标 df2 = pd.read_excel(file_path, sheet_name=sheet_names[1], header=None) data_2 = df2.iloc[5:47, [0, 1]].copy() data_2.columns = ['temp_dim', target_val_2] data_2[target_val_2] = pd.to_numeric(data_2[target_val_2], errors='coerce') # 交叉分析:基于索引或维度列合并 merged_df = pd.merge(data_1, data_2.reset_index(), left_index=True, right_index=True, how='inner') merged_df = merged_df[[group_col, target_val_1, target_val_2]].dropna(subset=[target_val_1]) # 筛选 Top N 结果 top5_df = merged_df.nlargest(5, target_val_1).reset_index(drop=True) top5_df.index = top5_df.index + 1 print(top5_df)
Step2 对筛选出的关键数据进行格式化标注(如标红、边框、对齐),生成美化后的 Excel 文件。
pythonfrom openpyxl import Workbook from openpyxl.styles import Font, PatternFill, Alignment, Border, Side output_path = 'analysis_report.xlsx' wb = Workbook() ws = wb.active ws.title = 'Top_Analysis' # 定义样式 header_fill = PatternFill(start_color='4472C4', end_color='4472C4', fill_type='solid') header_font = Font(bold=True, color='FFFFFF', size=12) red_font = Font(color='FF0000', bold=True) thin_border = Border(left=Side(style='thin'), right=Side(style='thin'), top=Side(style='thin'), bottom=Side(style='thin')) center_align = Alignment(horizontal='center', vertical='center') # 写入表头 headers = ['排名'] + list(top5_df.columns) for col, header in enumerate(headers, 1): cell = ws.cell(row=1, column=col, value=header) cell.font = header_font cell.fill = header_fill cell.alignment = center_align cell.border = thin_border # 写入数据并应用条件格式 for idx, row in top5_df.iterrows(): row_num = idx + 1 # 考虑表头 # 排名列 ws.cell(row=row_num, column=1, value=idx).border = thin_border # 维度列 ws.cell(row=row_num, column=2, value=row[group_col]).border = thin_border # 数值列 1 cell_v1 = ws.cell(row=row_num, column=3, value=row[target_val_1]) cell_v1.border = thin_border cell_v1.number_format = '#,##0' # 数值列 2(执行标红标注) cell_v2 = ws.cell(row=row_num, column=4, value=row[target_val_2]) cell_v2.font = red_font cell_v2.border = thin_border cell_v2.number_format = '#,##0.00' # 调整列宽 ws.column_dimensions['B'].width = 35 ws.column_dimensions['C'].width = 15 ws.column_dimensions['D'].width = 18 wb.save(output_path)
Step3 输出最终结果并生成下载链接。
python# 确认文件生成并提供下载 import os if os.path.exists(output_path): print(f"分析完成。结果文件已生成,下载链接:{output_path}") else: print("文件生成失败,请检查路径权限。")
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-02 | fail→fail | 15,770 | 8,884 | -44% | 1 | 1 | 0% | 3,580 | 3,251 | -9% | 0 | 0 | — |
case-01 | fail→pass | 16,752 | 12,427 | -26% | 1 | 1 | 0% | 3,751 | 3,461 | -8% | 0 | 0 | — |
case-03 | fail→fail | 22,341 | 9,972 | -55% | 1 | 1 | 0% | 3,773 | 3,502 | -7% | 0 | 0 | — |
case-04 | pass→pass | 3,319 | 2,686 | -19% | 1 | 1 | 0% | 599 | 1,702 | +184% | 0 | 0 | — |
case-05 | pass→pass | 11,687 | 6,309 | -46% | 1 | 1 | 0% | 2,006 | 2,440 | +22% | 0 | 0 | — |
case-06 | pass→pass | 3,401 | 2,798 | -18% | 1 | 1 | 0% | 588 | 1,734 | +195% | 0 | 0 | — |
case-07 | fail→pass | 9,039 | 5,585 | -38% | 1 | 1 | 0% | 1,766 | 2,358 | +34% | 0 | 0 | — |
case-08 | pass→pass | 8,662 | 3,924 | -55% | 1 | 1 | 0% | 1,291 | 1,694 | +31% | 0 | 0 | — |
case-09 | pass→pass | 7,145 | 2,925 | -59% | 1 | 1 | 0% | 1,104 | 1,729 | +57% | 0 | 0 | — |
case-10 | pass→pass | 6,205 | 3,950 | -36% | 1 | 1 | 0% | 1,340 | 1,850 | +38% | 0 | 0 | — |
case-11 | fail→pass | 10,249 | 3,719 | -64% | 1 | 1 | 0% | 1,911 | 1,866 | -2% | 0 | 0 | — |
case-12 | pass→pass | 13,202 | 1,790 | -86% | 1 | 1 | 0% | 1,946 | 1,561 | -20% | 0 | 0 | — |
case-13 | fail→pass | 8,134 | 3,416 | -58% | 1 | 1 | 0% | 1,522 | 1,845 | +21% | 0 | 0 | — |
case-14 | fail→fail | 5,625 | 4,452 | -21% | 1 | 1 | 0% | 982 | 2,105 | +114% | 0 | 0 | — |
case-15 | pass→pass | 8,377 | 4,600 | -45% | 1 | 1 | 0% | 1,539 | 2,114 | +37% | 0 | 0 | — |
case-16 | fail→fail | 11,526 | 4,686 | -59% | 1 | 1 | 0% | 1,621 | 2,122 | +31% | 0 | 0 | — |
case-17 | fail→pass | 12,428 | 11,459 | -8% | 1 | 1 | 0% | 2,386 | 3,009 | +26% | 0 | 0 | — |
case-18 | fail→pass | 5,890 | 1,622 | -72% | 1 | 1 | 0% | 1,060 | 1,529 | +44% | 0 | 0 | — |
case-19 | fail→pass | 7,283 | 8,753 | +20% | 1 | 1 | 0% | 1,421 | 2,744 | +93% | 0 | 0 | — |
case-20 | pass→pass | 6,163 | 3,579 | -42% | 1 | 1 | 0% | 1,239 | 1,931 | +56% | 0 | 0 | — |
case-21 | pass→pass | 8,763 | 10,067 | +15% | 1 | 1 | 0% | 1,856 | 2,859 | +54% | 0 | 0 | — |
case-22 | pass→pass | 11,136 | 7,357 | -34% | 1 | 1 | 0% | 2,345 | 2,736 | +17% | 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 +32 percentage points is the difference between those two pass rates over the 22 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.