Install any skill in seconds. Free to start, no credit card required.
Get Started Free →根据多维数值条件筛选 Excel 数据并导出结果,支持大规模数据的自动性能优化处理。
.claude/skills/opensensenova-excel-conditional-filtering-optimization/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 29% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 81% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 18% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 47% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 1% | 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 文件中所有工作表的数据,统计各表行数并汇总,用于评估数据规模。
pythonimport pandas as pd file_path = "input_data.xlsx" # 读取所有 sheet,统计行数 xls = pd.ExcelFile(file_path) print("Sheet names:", xls.sheet_names) total_rows = 0 sheet_details = [] for sheet in xls.sheet_names: df_temp = pd.read_excel(file_path, sheet_name=sheet) row_count = len(df_temp) sheet_details.append({"sheet": sheet, "rows": row_count}) total_rows += row_count print(f"Sheet details: {sheet_details}") print(f"Total rows across all sheets: {total_rows}")
Step2 对目标数据进行清洗,处理表头偏移,并将关键列转换为数值类型以确保计算准确。
python# 读取目标数据表 target_sheet = 'Sheet1' df = pd.read_excel(file_path, sheet_name=target_sheet, header=0) # 处理可能的子表头或空行偏移(示例:跳过第一行) # df = df.iloc[1:].reset_index(drop=True) # 统一设置列名(根据实际业务逻辑调整占位符) # df.columns = ['col_1', 'col_2', 'col_3', 'target_id', 'val_a', 'val_b', 'val_c'] # 强制转换数值列,处理非数值数据为 NaN numeric_cols = ['val_a', 'val_b', 'val_c', 'target_id'] for col in numeric_cols: if col in df.columns: df[col] = pd.to_numeric(df[col], errors='coerce') # 处理合并单元格(如有) # df = df.ffill()
Step3 执行多维度条件筛选逻辑,提取符合特定数值特征的唯一记录。
python# 筛选逻辑:例如 val_a, val_b, val_c 同时满足特定阈值(如均为 0) mask = (df['val_a'] == 0) & (df['val_b'] == 0) & (df['val_c'] == 0) filtered_df = df[mask][['target_id', 'val_a', 'val_b', 'val_c']] # 提取唯一编号并去除空值 result = filtered_df.drop_duplicates().dropna(subset=['target_id']).reset_index(drop=True)
Step4 将筛选后的结果保存为新的 Excel 文件,并生成下载链接。
pythonoutput_path = "filtered_analysis_result.xlsx" # 格式化输出列名 result.columns = ['Target_Index', 'Value_A', 'Value_B', 'Value_C'] # 导出文件 result.to_excel(output_path, index=False) # 打印结果摘要与下载路径 print(f"Filtered records count: {len(result)}") print(f"Result saved to: {output_path}")
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 10,487 | 8,932 | -15% | 1 | 1 | 0% | 2,179 | 2,814 | +29% | 0 | 0 | — |
case-02 | pass→pass | 9,796 | 6,317 | -36% | 1 | 1 | 0% | 2,026 | 2,050 | +1% | 0 | 0 | — |
case-03 | fail→pass | 4,271 | 3,395 | -21% | 1 | 1 | 0% | 786 | 1,420 | +81% | 0 | 0 | — |
case-04 | pass→pass | 5,411 | 4,209 | -22% | 1 | 1 | 0% | 1,059 | 1,649 | +56% | 0 | 0 | — |
case-05 | pass→pass | 9,907 | 6,826 | -31% | 1 | 1 | 0% | 1,842 | 2,124 | +15% | 0 | 0 | — |
case-06 | pass→pass | 9,689 | 7,172 | -26% | 1 | 1 | 0% | 1,899 | 2,191 | +15% | 0 | 0 | — |
case-07 | pass→pass | 4,959 | 2,464 | -50% | 1 | 1 | 0% | 935 | 1,244 | +33% | 0 | 0 | — |
case-08 | fail→pass | 7,865 | 4,411 | -44% | 1 | 1 | 0% | 1,396 | 1,643 | +18% | 0 | 0 | — |
case-09 | pass→pass | 5,048 | 2,173 | -57% | 1 | 1 | 0% | 976 | 1,148 | +18% | 0 | 0 | — |
case-10 | pass→pass | 6,814 | 6,185 | -9% | 1 | 1 | 0% | 1,305 | 1,774 | +36% | 0 | 0 | — |
case-11 | fail→pass | 6,714 | 5,512 | -18% | 1 | 1 | 0% | 1,261 | 1,849 | +47% | 0 | 0 | — |
case-12 | pass→pass | 5,809 | 3,774 | -35% | 1 | 1 | 0% | 959 | 1,400 | +46% | 0 | 0 | — |
case-13 | pass→pass | 8,792 | 6,484 | -26% | 1 | 1 | 0% | 1,649 | 2,041 | +24% | 0 | 0 | — |
case-14 | pass→pass | 4,320 | 3,570 | -17% | 1 | 1 | 0% | 649 | 1,363 | +110% | 0 | 0 | — |
case-15 | pass→pass | 8,126 | 5,273 | -35% | 1 | 1 | 0% | 1,597 | 1,710 | +7% | 0 | 0 | — |
case-16 | pass→pass | 3,858 | 2,735 | -29% | 1 | 1 | 0% | 727 | 1,295 | +78% | 0 | 0 | — |
case-17 | pass→pass | 11,978 | 10,051 | -16% | 1 | 1 | 0% | 2,123 | 2,638 | +24% | 0 | 0 | — |
case-18 | pass→pass | 3,464 | 3,784 | +9% | 1 | 1 | 0% | 597 | 1,520 | +155% | 0 | 0 | — |
case-19 | pass→pass | 7,526 | 4,085 | -46% | 1 | 1 | 0% | 1,418 | 1,631 | +15% | 0 | 0 | — |
case-20 | pass→pass | 15,568 | 13,854 | -11% | 1 | 1 | 0% | 3,030 | 3,555 | +17% | 0 | 0 | — |
case-21 | pass→pass | 11,280 | 8,031 | -29% | 1 | 1 | 0% | 2,245 | 2,400 | +7% | 0 | 0 | — |
case-22 | pass→pass | 14,316 | 16,094 | +12% | 1 | 1 | 0% | 2,875 | 3,984 | +39% | 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 +18 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.