excel-sheet-filter-export
Installation
SKILL.md
Skill Steps
This sub-skill covers one capability of the Excel workflow. For reading/counting/Parquet optimization, see the parent workflow SKILL.md.
Step1 读取目标Sheet,清理字段格式并根据特定条件筛选记录,统计关键指标。
target_sheet = 'Sheet1' # 替换为实际sheet名
df_target = pd.read_excel(file_path, sheet_name=target_sheet)
# 清理目标列的字符串格式(去除首尾空格)
filter_col = 'group_col'
if filter_col in df_target.columns:
df_target[filter_col] = df_target[filter_col].astype(str).str.strip()
# 筛选符合条件的记录
target_value = 'target_value_example'
mask = df_target[filter_col] == target_value
df_filtered = df_target[mask]