Install any skill in seconds. Free to start, no credit card required.
Get Started Free →当Excel文件总行数超过1万行时,通过转换为Parquet格式提升读取性能,提取目标指标并计算最大值,最后将结果输出为Excel并对特定行进行高亮标注。
.claude/skills/opensensenova-large-file-parquet-analysis-and-highlight/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | -47% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 425% | 0% |
| case-04 | ✗→✓ | ▲ Improved | -14% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 67% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 39% | 0% |
Step1 读取文件并统计所有 sheet 的行数,汇总后打印总行数,用于判断数据规模是否需要启用大文件处理。
pythonimport pandas as pd file_path = "input_data.xlsx" # 读取所有sheet并统计总行数 xls = pd.ExcelFile(file_path) sheet_names = xls.sheet_names print(f"Sheet列表: {sheet_names}") total_rows = 0 for sheet in sheet_names: # 仅读取一列以加快行数统计速度 df_temp = pd.read_excel(file_path, sheet_name=sheet, usecols=[0], header=None) rows = len(df_temp) total_rows += rows print(f"Sheet '{sheet}': {rows} 行") print(f"\n总行数 = {total_rows}")
Step2 当总行数 ≥ 1万时,读取已转换为 Parquet 格式的数据文件,通过行列匹配提取目标指标数据,并找出最大值及其对应分类。
pythonimport pandas as pd # 假设已通过大文件处理技能将Excel转换为Parquet parquet_path = "converted_data.parquet" df = pd.read_parquet(parquet_path) # 假设第2行(索引1)是分类表头(如:控股类型、区域等) header_row = df.iloc[1].tolist() print("分类表头:", header_row) # 找到目标指标所在的行(占位示例:'目标指标名称') target_metric = '目标指标名称' target_rows = df[df[0] == target_metric] if not target_rows.empty: # 提取数值 values = target_rows.iloc[0, 1:].tolist() # 清洗数据并找出最大值及其对应的分类 numeric_values = [] for val in values: try: numeric_values.append(float(val)) except: numeric_values.append(0) max_val = max(numeric_values) max_idx = numeric_values.index(max_val) max_type = header_row[1:][max_idx] print(f"\n指标最高的分类: {max_type} ({max_val})") # 准备写入Excel的数据结构 result_data = list(zip(header_row[1:], numeric_values))
Step3 将提取的分析结果保存为新的 Excel 文件,并使用 openpyxl 对最大值所在行进行背景色高亮标注,最后验证输出。
pythonfrom openpyxl import Workbook from openpyxl.styles import PatternFill from openpyxl import load_workbook output_path = "analysis_result.xlsx" wb = Workbook() ws = wb.active ws.title = "数据分析结果" # 写入表头 headers = ["分类类型", "指标数值"] ws.append(headers) # 写入数据 (使用Step2提取的 result_data,此处为防空值做备用示例) if 'result_data' not in locals(): result_data = [("分类A", 100), ("分类B", 500), ("分类C", 200)] max_type = "分类B" for row in result_data: ws.append(row) # 找到最大值所在行并标绿 green_fill = PatternFill(start_color="00FF00", end_color="00FF00", fill_type="solid") for row in ws.iter_rows(min_row=2, max_row=ws.max_row): if row[0].value == max_type: for cell in row: cell.fill = green_fill # 保存文件 wb.save(output_path) print(f"文件已保存到: {output_path}") # 验证输出文件内容及格式 wb_check = load_workbook(output_path) ws_check = wb_check.active print("\n文件内容验证:") for row in ws_check.iter_rows(values_only=True): print(row)
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 18,481 | 6,083 | -67% | 1 | 1 | 0% | 3,393 | 2,386 | -30% | 0 | 0 | — |
case-02 | fail→pass | 26,044 | 6,237 | -76% | 1 | 1 | 0% | 4,663 | 2,463 | -47% | 0 | 0 | — |
case-03 | fail→pass | 7,294 | 11,222 | +54% | 1 | 1 | 0% | 509 | 2,673 | +425% | 0 | 0 | — |
case-04 | fail→pass | 9,728 | 3,983 | -59% | 1 | 1 | 0% | 1,995 | 1,724 | -14% | 0 | 0 | — |
case-05 | fail→pass | 16,068 | 1,746 | -89% | 1 | 1 | 0% | 737 | 1,231 | +67% | 0 | 0 | — |
case-18 | pass→pass | 4,806 | 2,988 | -38% | 1 | 1 | 0% | 888 | 1,539 | +73% | 0 | 0 | — |
case-06 | fail→pass | 5,601 | 1,749 | -69% | 1 | 1 | 0% | 929 | 1,292 | +39% | 0 | 0 | — |
case-07 | fail→fail | 9,831 | 8,406 | -14% | 1 | 1 | 0% | 2,002 | 2,817 | +41% | 0 | 0 | — |
case-08 | fail→pass | 7,410 | 4,237 | -43% | 1 | 1 | 0% | 1,418 | 1,827 | +29% | 0 | 0 | — |
case-09 | pass→pass | 2,929 | 1,990 | -32% | 1 | 1 | 0% | 555 | 1,373 | +147% | 0 | 0 | — |
case-10 | fail→pass | 13,114 | 6,479 | -51% | 1 | 1 | 0% | 2,705 | 2,329 | -14% | 0 | 0 | — |
case-11 | pass→pass | 9,159 | 5,070 | -45% | 1 | 1 | 0% | 1,771 | 2,011 | +14% | 0 | 0 | — |
case-12 | fail→pass | 9,287 | 3,018 | -68% | 1 | 1 | 0% | 1,795 | 1,586 | -12% | 0 | 0 | — |
case-13 | fail→pass | 10,506 | 3,113 | -70% | 1 | 1 | 0% | 1,774 | 1,544 | -13% | 0 | 0 | — |
case-14 | fail→pass | 6,936 | 2,555 | -63% | 1 | 1 | 0% | 1,185 | 1,542 | +30% | 0 | 0 | — |
case-15 | fail→pass | 3,953 | 2,100 | -47% | 1 | 1 | 0% | 641 | 1,325 | +107% | 0 | 0 | — |
case-16 | fail→pass | 6,427 | 2,162 | -66% | 1 | 1 | 0% | 1,254 | 1,312 | +5% | 0 | 0 | — |
case-17 | pass→pass | 8,430 | 3,247 | -61% | 1 | 1 | 0% | 1,714 | 1,598 | -7% | 0 | 0 | — |
case-19 | pass→pass | 12,187 | 7,259 | -40% | 1 | 1 | 0% | 2,417 | 2,389 | -1% | 0 | 0 | — |
case-20 | pass→pass | 7,087 | 3,749 | -47% | 1 | 1 | 0% | 1,363 | 1,700 | +25% | 0 | 0 | — |
case-21 | pass→pass | 10,174 | 7,684 | -24% | 1 | 1 | 0% | 1,996 | 2,609 | +31% | 0 | 0 | — |
case-22 | pass→pass | 9,055 | 6,699 | -26% | 1 | 1 | 0% | 1,978 | 2,530 | +28% | 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, and 20 counted toward the lift figure. The other 2 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +55 percentage points is the difference between those two pass rates over the 20 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.