name: excel-conditional-filtering-optimization description: "根据多维数值条件筛选 Excel 数据并导出结果,支持大规模数据的自动性能优化处理。"
Excel_Conditional_Filtering_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}")