range-reading-and-large-file-analysis
Installation
SKILL.md
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 针对特定 Sheet 进行数据清洗与空值统计。支持处理带空格的列名,并计算关键指标的缺失率。
target_sheet = "Sheet2"
target_col = "是否通过" # 示例列名,实际根据需求替换
# 读取指定 Sheet
df_target = pd.read_excel(file_path, sheet_name=target_sheet)
# 清洗列名:去除首尾空格
df_target.columns = [str(col).strip() for col in df_target.columns]
if target_col in df_target.columns:
null_count = df_target[target_col].isna().sum()
print(f"'{target_col}' 列为空的数量: {null_count}")