Install any skill in seconds. Free to start, no credit card required.
Get Started Free →读取多 Sheet Excel 文件并统计规模,支持大文件向 Parquet 格式转换、分类数据统计及可视化报告生成。
.claude/skills/opensensenova-multi-file-excel-parquet-analysis/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -5% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 1% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 34% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 30% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 120% | 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 读取 Excel 文件,遍历所有 Sheet 统计行数,评估数据规模。
pythonimport pandas as pd import os file_path = "input_data.xlsx" # 替换为实际文件路径 if not os.path.exists(file_path): print(f"Error: 文件 {file_path} 不存在") else: # 获取所有 sheet 名称 xl = pd.ExcelFile(file_path) sheet_names = xl.sheet_names print("Sheet 列表:", sheet_names) total_rows = 0 for sheet in sheet_names: # 仅读取第一列以快速统计行数,避免大文件内存溢出 df_tmp = pd.read_excel(file_path, sheet_name=sheet, usecols=[0]) row_count = len(df_tmp) total_rows += row_count print(f"Sheet: {sheet}, 行数: {row_count}") print(f"总行数汇总: {total_rows}")
Step2 读取转换后的数据,执行分类统计分析,计算频数与占比。
pythonimport pandas as pd # 读取 Parquet 文件 df_analyzed = pd.read_parquet(output_parquet) # 定义目标统计列(如 '剪裁结果'、'状态' 等) target_col = '剪裁结果' if target_col in df_analyzed.columns: # 统计各分类数量及占比 counts = df_analyzed[target_col].value_counts() percent = df_analyzed[target_col].value_counts(normalize=True) * 100 # 构建统计表格并添加总计行 summary_df = pd.DataFrame({ '分类': counts.index, '数量': counts.values, '占比(%)': percent.values.round(2) }) # 添加总计行 total_row = pd.DataFrame([['总计', summary_df['数量'].sum(), 100.0]], columns=summary_df.columns) summary_df = pd.concat([summary_df, total_row], ignore_index=True) print("统计摘要:\n", summary_df) else: print(f"未找到目标列: {target_col}")
Step3 生成可视化饼图并保存分析报告,提供结果下载链接。
pythonimport matplotlib.pyplot as plt # 配置中文字体(实战技巧:防止图表乱码) plt.rcParams['font.sans-serif'] = ['SimHei', 'DejaVu Sans'] plt.rcParams['axes.unicode_minus'] = False if target_col in df_analyzed.columns: # 绘制饼图 plt.figure(figsize=(10, 7), dpi=100) plot_data = df_analyzed[target_col].value_counts() plt.pie(plot_data, labels=plot_data.index, autopct='%1.1f%%', startangle=90, colors=plt.cm.Paired.colors) plt.title(f'{target_col} 分布占比') # 保存图表 chart_output = "analysis_pie_chart.png" plt.savefig(chart_output, bbox_inches='tight') # 保存统计结果为 Excel report_output = "analysis_report.xlsx" summary_df.to_excel(report_output, index=False) print(f"分析图表已保存: {chart_output}") print(f"统计表格已保存: {report_output}") # 生成下载链接(用于报告展示) print(f"下载链接: {os.path.abspath(report_output)}")
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 13,135 | 6,405 | -51% | 1 | 1 | 0% | 2,444 | 2,321 | -5% | 0 | 0 | — |
case-02 | pass→pass | 14,576 | 6,353 | -56% | 1 | 1 | 0% | 2,240 | 2,285 | +2% | 0 | 0 | — |
case-03 | fail→pass | 10,965 | 10,214 | -7% | 1 | 1 | 0% | 2,440 | 2,473 | +1% | 0 | 0 | — |
case-04 | pass→pass | 14,769 | 12,557 | -15% | 1 | 1 | 0% | 2,006 | 2,724 | +36% | 0 | 0 | — |
case-05 | pass→pass | 18,812 | 12,318 | -35% | 1 | 1 | 0% | 2,454 | 3,392 | +38% | 0 | 0 | — |
case-06 | pass→pass | 8,838 | 5,090 | -42% | 1 | 1 | 0% | 1,735 | 2,067 | +19% | 0 | 0 | — |
case-07 | pass→pass | 11,582 | 9,918 | -14% | 1 | 1 | 0% | 1,871 | 2,605 | +39% | 0 | 0 | — |
case-08 | fail→pass | 10,433 | 4,711 | -55% | 1 | 1 | 0% | 1,388 | 1,857 | +34% | 0 | 0 | — |
case-09 | pass→pass | 5,611 | 7,545 | +34% | 1 | 1 | 0% | 1,090 | 2,199 | +102% | 0 | 0 | — |
case-10 | pass→pass | 5,911 | 3,948 | -33% | 1 | 1 | 0% | 1,059 | 1,543 | +46% | 0 | 0 | — |
case-11 | fail→pass | 15,205 | 10,749 | -29% | 1 | 1 | 0% | 2,074 | 2,697 | +30% | 0 | 0 | — |
case-12 | fail→pass | 3,788 | 3,685 | -3% | 1 | 1 | 0% | 735 | 1,619 | +120% | 0 | 0 | — |
case-13 | pass→pass | 11,736 | 13,519 | +15% | 1 | 1 | 0% | 2,207 | 2,822 | +28% | 0 | 0 | — |
case-14 | pass→pass | 3,886 | 2,934 | -24% | 1 | 1 | 0% | 715 | 1,426 | +99% | 0 | 0 | — |
case-15 | pass→pass | 3,920 | 3,741 | -5% | 1 | 1 | 0% | 771 | 1,433 | +86% | 0 | 0 | — |
case-16 | pass→pass | 9,311 | 7,042 | -24% | 1 | 1 | 0% | 1,768 | 2,276 | +29% | 0 | 0 | — |
case-17 | pass→pass | 12,372 | 7,379 | -40% | 1 | 1 | 0% | 1,808 | 2,374 | +31% | 0 | 0 | — |
case-18 | pass→pass | 8,710 | 6,125 | -30% | 1 | 1 | 0% | 1,387 | 2,263 | +63% | 0 | 0 | — |
case-19 | pass→pass | 11,139 | 3,818 | -66% | 1 | 1 | 0% | 1,626 | 1,665 | +2% | 0 | 0 | — |
case-20 | pass→pass | 13,774 | 8,062 | -41% | 1 | 1 | 0% | 2,833 | 2,579 | -9% | 0 | 0 | — |
case-21 | pass→pass | 11,240 | 10,601 | -6% | 1 | 1 | 0% | 2,345 | 3,088 | +32% | 0 | 0 | — |
case-22 | pass→pass | 9,425 | 5,813 | -38% | 1 | 1 | 0% | 1,908 | 2,075 | +9% | 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 +23 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.