Ask me what skills you need
What are you building?
Tell me what you're working on and I'll find the best agent skills for you.
根据多维数值条件筛选 Excel 数据并导出结果,支持大规模数据的自动性能优化处理。
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']
npx skills add OpenSenseNova/SenseNova-Skills --skill range-filteringHow clear and easy to understand the SKILL.md instructions are, rated from 1 to 5.
Clear and well structured, with only minor parts that might need a second read.
How directly an agent can act on the SKILL.md instructions, rated from 1 to 5.
Mostly actionable with clear steps; only a few small gaps remain.