name: excel-multi-sheet-threshold-analysis description: "统计多Sheet Excel总行数并根据规模选择处理策略,提取特定维度信息进行去重统计,并生成摘要与明细报表。"
Excel_Multi_Sheet_Deduplication
This sub-skill covers one capability of the Excel workflow. For reading/counting/Parquet optimization, see the parent workflow SKILL.md.
Step1 加载目标数据表,并进行初步的数据预览与结构检查。
import pandas as pd
file_path = 'input_file.xlsx'
target_sheet = 'Sheet1' # 根据实际情况指定 sheet 名称
# 读取数据,header=None 用于处理无表头或非标准表头文件
df = pd.read_excel(file_path, sheet_name=target_sheet, header=None)
print(f"数据形状: {df.shape}")
print("前 5 行预览:")
print(df.head())
Step2 遍历数据行,基于关键词提取目标信息,并执行数据清洗(去除空格、空值过滤)。