AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Excel Conditional Filtering Optimization

skill-opensensenova-sensenova-skills-range-filtering · by OpenSenseNova

根据多维数值条件筛选 Excel 数据并导出结果,支持大规模数据的自动性能优化处理。

No reviews yet
0 installs
3 views
0.0% view→install

Install

$ agentstack add skill-opensensenova-sensenova-skills-range-filtering

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-opensensenova-sensenova-skills-range-filtering)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
1mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Excel Conditional Filtering Optimization? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

ExcelConditionalFiltering_Optimization

> 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 文件中所有工作表的数据,统计各表行数并汇总,用于评估数据规模。

import 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 对目标数据进行清洗,处理表头偏移,并将关键列转换为数值类型以确保计算准确。

# 读取目标数据表
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 执行多维度条件筛选逻辑,提取符合特定数值特征的唯一记录。

# 筛选逻辑:例如 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 文件,并生成下载链接。

output_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}")

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.