Install any skill in seconds. Free to start, no credit card required.
Get Started Free →用于处理多Sheet大型Excel文件,支持大文件Parquet格式转换提速,并使用openpyxl生成带条件高亮和自定义样式的格式化Excel报告及下载链接。
.claude/skills/opensensenova-large-excel-analysis-and-formatting/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -30% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 40% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 22% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 4% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 9% | 0% |
Step1 读取Excel文件,统计所有Sheet的总行数。若数据量过大(如≥1万行),则转换为Parquet格式以显著提升后续读取和分析效率。
pythonimport pandas as pd file_path = "input.xlsx" xls = pd.ExcelFile(file_path) total_rows = 0 # 统计所有 sheet 的总行数 for name in xls.sheet_names: df_temp = pd.read_excel(file_path, sheet_name=name, header=None) total_rows += len(df_temp) print(f"总行数: {total_rows}") # 大文件处理:超过阈值转换为 Parquet 提升效率 if total_rows >= 10000: parquet_path = "/mnt/data/temp.parquet" # 此处以读取第一个sheet为例,实际可根据需求合并多个sheet df = pd.read_excel(file_path, sheet_name=0) df.to_parquet(engine='pyarrow', path=parquet_path) df = pd.read_parquet(parquet_path) else: df = pd.read_excel(file_path, sheet_name=0)
Step2 提取目标数据进行分组汇总分析,并识别出最大值及其对应的分类项。
python# 占位示例:根据实际数据集替换列名 group_col = '分类列名' # 如 '控股类型' target_col = '目标数值列' # 如 '建筑业总产值' # 假设 df 已清洗并包含所需列,进行汇总分析 summary = df.groupby(group_col)[target_col].sum().reset_index() # 识别最大值及其对应的分类 max_idx = summary[target_col].idxmax() max_type = summary.loc[max_idx, group_col] print(f"最高产值类型: {max_type}")
Step3 使用 openpyxl 将分析结果写入新的Excel文件,配置表头样式、边框、列宽,并对满足特定条件(如最大值)的行进行绿色高亮标注,最后生成下载链接。
pythonfrom openpyxl import Workbook from openpyxl.styles import PatternFill, Font, Alignment, Border, Side wb = Workbook() ws = wb.active ws.title = "分析报告" # 样式定义 header_fill = PatternFill(start_color="4472C4", end_color="4472C4", fill_type="solid") header_font = Font(name="微软雅黑", bold=True, color="FFFFFF", size=12) highlight_fill = PatternFill(start_color="00B050", end_color="00B050", fill_type="solid") highlight_font = Font(name="微软雅黑", bold=True, color="FFFFFF", size=12) normal_font = Font(name="微软雅黑", size=11) center_align = Alignment(horizontal="center", vertical="center") thin_border = Border( left=Side(style="thin"), right=Side(style="thin"), top=Side(style="thin"), bottom=Side(style="thin") ) # 写入表头并应用样式 headers = [group_col, target_col] for col, header in enumerate(headers, 1): cell = ws.cell(row=1, column=col, value=header) cell.fill = header_fill cell.font = header_font cell.alignment = center_align cell.border = thin_border # 写入数据并进行条件高亮 for row_idx, row_data in enumerate(summary.itertuples(index=False), 2): type_name, value = row_data[0], row_data[1] cell_type = ws.cell(row=row_idx, column=1, value=type_name) cell_value = ws.cell(row=row_idx, column=2, value=value) # 基础样式 for cell in [cell_type, cell_value]: cell.alignment = center_align cell.border = thin_border cell.font = normal_font # 命中最大值条件时高亮整行 if type_name == max_type: cell_type.fill = highlight_fill cell_type.font = highlight_font cell_value.fill = highlight_fill cell_value.font = highlight_font # 调整列宽 ws.column_dimensions['A'].width = 18 ws.column_dimensions['B'].width = 25 # 保存文件 output_path = "/mnt/data/formatted_analysis_report.xlsx" wb.save(output_path) print(f"文件已保存至: {output_path}") # 提供下载链接 download_link = f"sandbox:{output_path}" print(f"下载链接: {download_link}")
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 21,656 | 10,735 | -50% | 1 | 1 | 0% | 4,799 | 3,360 | -30% | 0 | 0 | — |
case-12 | fail→fail | 9,437 | 6,161 | -35% | 1 | 1 | 0% | 1,656 | 2,244 | +36% | 0 | 0 | — |
case-02 | fail→fail | 17,019 | 13,757 | -19% | 1 | 1 | 0% | 3,759 | 4,574 | +22% | 0 | 0 | — |
case-03 | fail→fail | 25,848 | 10,484 | -59% | 1 | 1 | 0% | 3,919 | 3,363 | -14% | 0 | 0 | — |
case-04 | fail→pass | 15,730 | 15,526 | -1% | 1 | 1 | 0% | 3,074 | 4,314 | +40% | 0 | 0 | — |
case-05 | fail→pass | 25,338 | 22,678 | -10% | 1 | 1 | 0% | 4,281 | 5,234 | +22% | 0 | 0 | — |
case-06 | fail→fail | 17,138 | 17,653 | +3% | 1 | 1 | 0% | 3,848 | 4,095 | +6% | 0 | 0 | — |
case-07 | pass→pass | 6,356 | 2,795 | -56% | 1 | 1 | 0% | 1,270 | 1,666 | +31% | 0 | 0 | — |
case-08 | fail→pass | 26,363 | 18,389 | -30% | 1 | 1 | 0% | 4,502 | 4,700 | +4% | 0 | 0 | — |
case-09 | fail→fail | 9,977 | 6,125 | -39% | 1 | 1 | 0% | 1,967 | 2,433 | +24% | 0 | 0 | — |
case-10 | fail→fail | 12,077 | 6,197 | -49% | 1 | 1 | 0% | 2,384 | 2,122 | -11% | 0 | 0 | — |
case-11 | fail→pass | 11,071 | 6,881 | -38% | 1 | 1 | 0% | 2,377 | 2,590 | +9% | 0 | 0 | — |
case-13 | pass→pass | 6,939 | 4,020 | -42% | 1 | 1 | 0% | 1,201 | 1,891 | +57% | 0 | 0 | — |
case-14 | pass→pass | 13,031 | 9,688 | -26% | 1 | 1 | 0% | 2,504 | 2,832 | +13% | 0 | 0 | — |
case-15 | pass→pass | 9,944 | 7,749 | -22% | 1 | 1 | 0% | 2,121 | 2,490 | +17% | 0 | 0 | — |
case-16 | fail→pass | 10,657 | 8,435 | -21% | 1 | 1 | 0% | 2,072 | 2,444 | +18% | 0 | 0 | — |
case-17 | fail→pass | 8,313 | 2,388 | -71% | 1 | 1 | 0% | 1,339 | 1,544 | +15% | 0 | 0 | — |
case-18 | pass→pass | 9,907 | 4,663 | -53% | 1 | 1 | 0% | 1,671 | 1,878 | +12% | 0 | 0 | — |
case-19 | fail→fail | 17,953 | 10,198 | -43% | 1 | 1 | 0% | 3,237 | 2,468 | -24% | 0 | 0 | — |
case-20 | fail→pass | 19,024 | 11,678 | -39% | 1 | 1 | 0% | 4,164 | 4,010 | -4% | 0 | 0 | — |
case-21 | pass→pass | 18,840 | 16,438 | -13% | 1 | 1 | 0% | 3,452 | 4,298 | +25% | 0 | 0 | — |
case-22 | pass→pass | 13,505 | 11,757 | -13% | 1 | 1 | 0% | 3,058 | 3,825 | +25% | 0 | 0 | — |
case-23 | pass→pass | 12,301 | 15,226 | +24% | 1 | 1 | 0% | 2,661 | 3,786 | +42% | 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. 23 cases were attempted. The headline lift of +35 percentage points is the difference between those two pass rates over the 23 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.