Install any skill in seconds. Free to start, no credit card required.
Get Started Free →根据文件行数动态切换大文件处理策略(Parquet转换),通过逐行扫描或列匹配提取关键指标并计算占比、均值等统计量,最终输出结构化Excel报告及可视化图表。
.claude/skills/opensensenova-dynamic-percentage-and-large-file-analysis/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 78% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 4% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 112% | 0% |
| case-17 | ✗→✓ | ▲ Improved | 77% | 0% |
| case-20 | ✗→✓ | ▲ Improved | 20% | 0% |
> This sub-skill covers one capability of the Excel workflow. For reading/counting/Parquet optimization, see the parent workflow SKILL.md.
Step1 在数据中动态定位关键字段,通过逐行扫描匹配关键词提取数值,并进行条件筛选与占比计算。
pythonkey_values = {} target_col = None value_col = 'target_value_col' # 动态查找目标分类列 for col in df_analysis.columns: if 'keyword1' in col.lower() or 'keyword2' in col.lower(): target_col = col break # 通用字段查找逻辑:逐行扫描匹配关键词并提取首个正数 for idx, row in df_analysis.iterrows(): row_str = str(row.values) if '指标A' in row_str and '指标A' not in key_values: for val in row.values: if isinstance(val, (int, float)) and val > 0: key_values['指标A'] = val break if '指标B' in row_str and '指标B' not in key_values: for val in row.values: if isinstance(val, (int, float)) and val > 0: key_values['指标B'] = val break # 条件筛选与统计 if target_col and '特定类别' in df_analysis[target_col].unique(): df_filtered = df_analysis[df_analysis[target_col] == '特定类别'] if value_col in df_filtered.columns: df_filtered[value_col] = pd.to_numeric(df_filtered[value_col], errors='coerce') avg_val = df_filtered[value_col].mean() print(f"特定类别平均值 = {avg_val:.2f}") # 计算占比 if '指标A' in key_values and '指标B' in key_values: percentage = (key_values['指标A'] / key_values['指标B']) * 100 print(f"指标A占指标B的百分比: {percentage:.2f}%")
Step2 将计算结果保存为结构化表格文件(.xlsx),并在输出中提供可追溯的下载链接。
pythonoutput_path = "output_analysis_result.xlsx" os.makedirs(os.path.dirname(output_path), exist_ok=True) result_data = { '项目': ['指标A', '指标B', '占比'], '数值': [key_values.get('指标A', 0), key_values.get('指标B', 0), f"{percentage:.2f}%" if 'percentage' in locals() else "N/A"] } df_result = pd.DataFrame(result_data) with pd.ExcelWriter(output_path, engine='openpyxl') as writer: df_result.to_excel(writer, sheet_name='汇总结果', index=False) print(f"结果已保存到: {output_path}") print(f"下载链接: [点击下载结果表格]({output_path})")
Step3 配置中文字体并生成高分辨率的可视化图表(如饼图),展示占比分析结果。
pythonimport matplotlib.pyplot as plt import matplotlib # 配置中英文字体,防止图表中文乱码 matplotlib.rcParams['font.sans-serif'] = ['SimHei', 'DejaVu Sans', 'WenQuanYi Zen Hei'] matplotlib.rcParams['axes.unicode_minus'] = False if 'percentage' in locals(): # 图表美化与高分辨率设置 plt.figure(figsize=(8, 6), dpi=120) labels = ['指标A', '其他'] sizes = [percentage, 100 - percentage] colors = ['#ff9999', '#66b3ff'] plt.pie(sizes, labels=labels, colors=colors, autopct='%1.1f%%', startangle=90) plt.title('核心指标占比分析') plt.axis('equal') chart_path = "percentage_chart.png" plt.savefig(chart_path, bbox_inches='tight') print(f"图表已保存至: {chart_path}") print(f"图表下载链接: [点击下载可视化图表]({chart_path})")
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-04 | pass→pass | 13,809 | 11,657 | -16% | 1 | 1 | 0% | 2,680 | 3,269 | +22% | 0 | 0 | — |
case-01 | fail→pass | 9,264 | 10,411 | +12% | 1 | 1 | 0% | 1,545 | 2,744 | +78% | 0 | 0 | — |
case-02 | fail→pass | 13,335 | 8,841 | -34% | 1 | 1 | 0% | 2,758 | 2,880 | +4% | 0 | 0 | — |
case-03 | pass→pass | 13,808 | 13,142 | -5% | 1 | 1 | 0% | 2,770 | 3,142 | +13% | 0 | 0 | — |
case-05 | pass→pass | 13,223 | 11,957 | -10% | 1 | 1 | 0% | 2,917 | 3,754 | +29% | 0 | 0 | — |
case-06 | pass→pass | 17,484 | 8,834 | -49% | 1 | 1 | 0% | 2,537 | 2,342 | -8% | 0 | 0 | — |
case-07 | pass→pass | 2,603 | 8,576 | +229% | 1 | 1 | 0% | 586 | 2,698 | +360% | 0 | 0 | — |
case-08 | fail→pass | 4,585 | 7,593 | +66% | 1 | 1 | 0% | 954 | 2,025 | +112% | 0 | 0 | — |
case-09 | pass→pass | 2,551 | 2,525 | -1% | 1 | 1 | 0% | 484 | 1,351 | +179% | 0 | 0 | — |
case-10 | pass→pass | 9,930 | 7,022 | -29% | 1 | 1 | 0% | 2,024 | 1,951 | -4% | 0 | 0 | — |
case-11 | pass→pass | 7,155 | 4,204 | -41% | 1 | 1 | 0% | 1,345 | 1,783 | +33% | 0 | 0 | — |
case-12 | pass→pass | 18,800 | 6,560 | -65% | 1 | 1 | 0% | 3,336 | 2,451 | -27% | 0 | 0 | — |
case-13 | pass→pass | 16,437 | 3,812 | -77% | 1 | 1 | 0% | 3,463 | 1,841 | -47% | 0 | 0 | — |
case-14 | pass→pass | 4,600 | 2,882 | -37% | 1 | 1 | 0% | 908 | 1,543 | +70% | 0 | 0 | — |
case-15 | pass→pass | 11,625 | 4,676 | -60% | 1 | 1 | 0% | 2,172 | 1,869 | -14% | 0 | 0 | — |
case-16 | pass→pass | 6,200 | 3,743 | -40% | 1 | 1 | 0% | 1,247 | 1,682 | +35% | 0 | 0 | — |
case-17 | fail→pass | 7,790 | 7,691 | -1% | 1 | 1 | 0% | 1,209 | 2,134 | +77% | 0 | 0 | — |
case-18 | pass→pass | 4,812 | 4,535 | -6% | 1 | 1 | 0% | 929 | 1,932 | +108% | 0 | 0 | — |
case-19 | pass→pass | 13,572 | 10,189 | -25% | 1 | 1 | 0% | 2,441 | 2,514 | +3% | 0 | 0 | — |
case-20 | fail→pass | 8,547 | 5,101 | -40% | 1 | 1 | 0% | 1,642 | 1,973 | +20% | 0 | 0 | — |
case-21 | pass→pass | 8,368 | 4,116 | -51% | 1 | 1 | 0% | 1,568 | 1,872 | +19% | 0 | 0 | — |
case-22 | pass→pass | 4,760 | 3,826 | -20% | 1 | 1 | 0% | 864 | 1,738 | +101% | 0 | 0 | — |
case-23 | pass→pass | 6,468 | 3,513 | -46% | 1 | 1 | 0% | 938 | 1,616 | +72% | 0 | 0 | — |
case-24 | pass→pass | 5,775 | 8,585 | +49% | 1 | 1 | 0% | 1,105 | 2,543 | +130% | 0 | 0 | — |
case-25 | fail→pass | 12,029 | 5,047 | -58% | 1 | 1 | 0% | 1,693 | 1,974 | +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. 25 cases were attempted. The headline lift of +24 percentage points is the difference between those two pass rates over the 25 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.