chart-embedded-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 执行数据清洗,处理合并单元格,使用正则表达式清理文本,并建立分类映射函数骨架。
target_col = '分类字段'
value_col = '数值字段'
# 合并单元格处理 (向下填充还原)
df[target_col] = df[target_col].ffill()
# 数据清洗:正则去除特殊字符、去空、类型转换
df[target_col] = df[target_col].astype(str).str.replace(r'[^\w\s]', '', regex=True).str.strip()
df[value_col] = pd.to_numeric(df[value_col], errors='coerce')
df = df.dropna(subset=[target_col, value_col])