一键导入
excel-sheet-filter-export
动态统计多Sheet Excel文件行数以判断大文件处理逻辑,并根据特定条件筛选数据、重命名字段后导出为包含下载链接的新Excel文件,适用于多Sheet数据探查与条件过滤导出场景。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
动态统计多Sheet Excel文件行数以判断大文件处理逻辑,并根据特定条件筛选数据、重命名字段后导出为包含下载链接的新Excel文件,适用于多Sheet数据探查与条件过滤导出场景。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Base-layer skill for the SenseNova-Skills project, providing low-level APIs for image generation, recognition (VLM), and text optimization (LLM). This skill does not preprocess inputs; it only calls backend services and returns results. This skill is not user-facing and is intended for upper-layer skills only.
用于用户请求深度研究、系统性研究、竞品分析、方案对比、趋势分析或事实核查时。**遇到以下任一情况就主动使用本 skill,不要自行搜几条就回答**:①用户出现触发词:深度研究 / 深度调研 / 深入研究 / 全面研究 / 系统研究 / 调研 / 调查 / 尽调 / 行业研究 / 市场研究 / 竞品分析 / 政策研究 / 技术研究 / 趋势研究 / 事实核查 / 写一份研究报告 / 调研报告 / 深度报告 / research / deep research;②请求需要跨多来源取证、多维度对比、交叉验证才能给出可靠结论;③用户要求产出报告、白皮书、行业分析或尽调文档;④话题涉及最新政策/市场/产品/价格/法规,需要系统核查。明确要求核验来源的单点事实可走 quick;无核验要求的简单常识问答不使用。模糊或宽泛的"研究/了解一下 X"也优先触发。仅不用于:一句话摘要、已给定单一来源的整理、纯文字润色改写。
用于研究任务的最终呈现形式未知时。比较研究报告、学术论文、表格优先报表、决策备忘录或自定义形式,并用权威标准与真实范例支持推荐。
用于搜索中文社交平台。脚本入口覆盖 B站视频、知乎问答和抖音视频;小红书、微博当前没有脚本入口,只能通过 browser-use / 公开网页兜底。
搜索社区、社媒、新闻热点、百科趋势、开发者生态和技术讨论时使用。
用于学术调研、论文精读、相关工作梳理、百科知识查询和引用链追溯。
| name | excel-sheet-filter-export |
| description | 动态统计多Sheet Excel文件行数以判断大文件处理逻辑,并根据特定条件筛选数据、重命名字段后导出为包含下载链接的新Excel文件,适用于多Sheet数据探查与条件过滤导出场景。 |
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]
# 统计特定范围的种类数量
target_col = 'target_col'
if target_col in df_filtered.columns:
specific_ranges = df_filtered[target_col].dropna().unique()
print(f"{target_col} 种类数量:", len(specific_ranges))
# 统计各分类数量与占比
value_counts_df = df_filtered[target_col].value_counts().reset_index()
value_counts_df.columns = [target_col, '数量']
value_counts_df['占比'] = (value_counts_df['数量'] / value_counts_df['数量'].sum()).map('{:.2%}'.format)
# 添加总计行
total_row = pd.DataFrame({
target_col: ['总计'],
'数量': [value_counts_df['数量'].sum()],
'占比': ['100.00%']
})
value_counts_df = pd.concat([value_counts_df, total_row], ignore_index=True)
print(f"\n{target_col} 分布情况:\n", value_counts_df.head())
Step2 提取所需字段,对结果进行字段重命名与格式化处理,保存为新的Excel文件并生成下载链接。
# 提取需要的列并重命名
selected_cols = ['col1', 'col2', filter_col, target_col]
# 确保列存在
existing_cols = [col for col in selected_cols if col in df_filtered.columns]
result_df = df_filtered[existing_cols].copy()
# 字段重命名映射字典
rename_mapping = {
'col1': '重命名列1',
'col2': '重命名列2',
filter_col: '筛选维度',
target_col: '分析维度'
}
result_df = result_df.rename(columns=rename_mapping)
# 保存结果并提供下载链接
output_path = "filtered_result_output.xlsx"
result_df.to_excel(output_path, index=False)
print("结果已保存至:", output_path)
print(f"[下载结果文件](sandbox:{output_path})")