/basic-statistics
对多Sheet Excel文件进行基础统计与,支持按条件筛选计算均值,以及从指定行区间提取数据去重求和,并生成结果文件与下载链接。
$ npx -y skills add OpenSenseNova/SenseNova-Skills --skill basic-statistics --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/basic-statistics
Context preview
The summary Claude sees to decide when to auto-load this skill.
对多Sheet Excel文件进行基础统计与,支持按条件筛选计算均值,以及从指定行区间提取数据去重求和,并生成结果文件与下载链接。
SKILL.md
basic-statistics.SKILL.mdname: excel-basic-statistics-and-routing
description: "对多Sheet Excel文件进行基础统计与,支持按条件筛选计算均值,以及从指定行区间提取数据去重求和,并生成结果文件与下载链接。"
Skill Steps
> This sub-skill covers one capability of the Excel workflow. For reading/counting/Parquet optimization, see the parent workflow SKILL.md.
Step1 筛选指定分组数据,将目标列转换为数值类型并计算平均值。
group_col = '班级' # 占位示例
target_group_value = '358' # 占位示例
target_cols = ['总分', '理数'] # 占位示例
if group_col not in df_analysis.columns:
raise ValueError(f"数据中缺少'{group_col}'列。")
df_analysis[group_col] = df_analysis[group_col].astype(str)
filtered_df = df_analysis[df_analysis[group_col] == target_group_value]
avg_scores = {}
for col in target_cols:
if col not in filtered_df.columns:
raise ValueError(f"数据中缺少'{col}'列。")
try:
filtered_df[col] = pd.to_numeric(filtered_df[col], errors='raise')
avg_scores[f'平均{col}'] = filtered_df[col].mean()
except Exception as e:
raise ValueError(f"列'{col}'无法转换为数值类型: {str(e)}")
output("筛选结果统计: " + str(avg_scores))Step2 对于小文件,从特定 Sheet 的指定行区间提取目标字段,去重后计算总和。
unique_components = {}
total_power = 0
if total_rows < 10000:
target_sheet = 'Sheet2' # 占位示例
df_sheet2 = pd.read_excel(file_path, sheet_name=target_sheet)
extracted_data = []
# 提取区间1 (例如 21-28行)
for i in range(21, 29):
if i < len(df_sheet2):
row = df_sheet2.iloc[i]
component = row.iloc[0]
power = row.iloc[6]
if pd.notna(component) and pd.notna(power):
try:
extracted_data.append({'Component': component, 'Value': float(power)})
except:
pass
# 提取区间2 (例如 51-58行)
for i in range(51, 59):
if i < len(df_sheet2):
row = df_sheet2.iloc[i]
component = row.iloc[0]
power = row.iloc[1]
if pd.notna(component) and pd.notna(power):
try:
extracted_data.append({'Component': component, 'Value': float(power)})
except:
pass
# 合并并去重 (保留首次出现的值)
for item in extracted_data:
name = item['Component']
val = item['Value']
if name not in unique_components:
unique_components[name] = val
total_power = sum(unique_components.values())Step3 将计算结果、筛选数据和统计信息保存为Excel文件,并生成本地下载链接。
import os
# 保存区间提取与汇总结果
if total_rows < 10000:
result_df = pd.DataFrame([
{'Component Name': name, 'Est. Power (kW)': power}
for name, power in unique_components.items()
])
total_row = pd.DataFrame([{'Component Name': '合计', 'Est. Power (kW)': total_power}])
result_df = pd.concat([result_df, total_row], ignore_index=True)
output_path_power = "output_power_sum.xlsx"
result_df.to_excel(output_path_power, index=False)
output(f"功率计算结果已保存。下载链接: file://{os.path.abspath(output_path_power)}")
# 保存筛选与统计结果
output_path_analysis = "output_analysis_result.xlsx"
with pd.ExcelWriter(output_path_analysis, engine='openpyxl') as writer:
filtered_df.to_excel(writer, sheet_name="筛选数据", index=False)
pd.DataFrame([avg_scores]).to_excel(writer, sheet_name="统计信息", index=False)
output(f"分析完成,结果已保存。下载链接: file://{os.path.abspath(output_path_analysis)}")Read more
name: excel-basic-statistics-and-routing description: "对多Sheet Excel文件进行基础统计与,支持按条件筛选计算均值,以及从指定行区间提取数据去重求和,并生成结果文件与下载链接。"
Skill Steps
> This sub-skill covers one capability of the Excel workflow. For reading/counting/Parquet optimization, see the parent workflow SKILL.md.
Step1 筛选指定分组数据,将目标列转换为数值类型并计算平均值。
group_col = '班级' # 占位示例
target_group_value = '358' # 占位示例
target_cols = ['总分', '理数'] # 占位示例
if group_col not in df_analysis.columns:
raise ValueError(f"数据中缺少'{group_col}'列。")
df_analysis[group_col] = df_analysis[group_col].astype(str)
filtered_df = df_analysis[df_analysis[group_col] == target_group_value]
avg_scores = {}
for col in target_cols:
if col not in filtered_df.columns:
raise ValueError(f"数据中缺少'{col}'列。")
try:
filtered_df[col] = pd.to_numeric(filtered_df[col], errors='raise')
avg_scores[f'平均{col}'] = filtered_df[col].mean()
except Exception as e:
raise ValueError(f"列'{col}'无法转换为数值类型: {str(e)}")
output("筛选结果统计: " + str(avg_scores))Step2 对于小文件,从特定 Sheet 的指定行区间提取目标字段,去重后计算总和。
unique_components = {}
total_power = 0
if total_rows < 10000:
target_sheet = 'Sheet2' # 占位示例
df_sheet2 = pd.read_excel(file_path, sheet_name=target_sheet)
extracted_data = []
# 提取区间1 (例如 21-28行)
for i in range(21, 29):
if i < len(df_sheet2):
row = df_sheet2.iloc[i]
component = row.iloc[0]
power = row.iloc[6]
if pd.notna(component) and pd.notna(power):
try:
extracted_data.append({'Component': component, 'Value': float(power)})
except:
pass
# 提取区间2 (例如 51-58行)
for i in range(51, 59):
if i < len(df_sheet2):
row = df_sheet2.iloc[i]
component = row.iloc[0]
power = row.iloc[1]
if pd.notna(component) and pd.notna(power):
try:
extracted_data.append({'Component': component, 'Value': float(power)})
except:
pass
# 合并并去重 (保留首次出现的值)
for item in extracted_data:
name = item['Component']
val = item['Value']
if name not in unique_components:
unique_components[name] = val
total_power = sum(unique_components.values())Step3 将计算结果、筛选数据和统计信息保存为Excel文件,并生成本地下载链接。
import os
# 保存区间提取与汇总结果
if total_rows < 10000:
result_df = pd.DataFrame([
{'Component Name': name, 'Est. Power (kW)': power}
for name, power in unique_components.items()
])
total_row = pd.DataFrame([{'Component Name': '合计', 'Est. Power (kW)': total_power}])
result_df = pd.concat([result_df, total_row], ignore_index=True)
output_path_power = "output_power_sum.xlsx"
result_df.to_excel(output_path_power, index=False)
output(f"功率计算结果已保存。下载链接: file://{os.path.abspath(output_path_power)}")
# 保存筛选与统计结果
output_path_analysis = "output_analysis_result.xlsx"
with pd.ExcelWriter(output_path_analysis, engine='openpyxl') as writer:
filtered_df.to_excel(writer, sheet_name="筛选数据", index=False)
pd.DataFrame([avg_scores]).to_excel(writer, sheet_name="统计信息", index=False)
output(f"分析完成,结果已保存。下载链接: file://{os.path.abspath(output_path_analysis)}")The SenseNova model family plugs directly into agent runtimes such as OpenClaw and hermes-agent, with the skills in this repository extending the models with concrete, end-to-end office capabilities.
Repo: OpenSenseNova/SenseNova-Skills
Other skills on sensenova-skills.
- /sn-da-excel-workflow
Excel 数据分析多步编排器。覆盖:(1) 读取多 Sheet Excel 文件并统计行数,(2) 大文件检测(≥10k 行自动 Parquet 优化),(3) 数据清洗(缺失值、文本标准化、无效字符),(4) 条件筛选与分类提取,(5) 跨 Sheet 统计聚合,(6) 导出 Excel/CSV 并提供下载链接。覆盖从数据读取到报告生成全流程,按步骤编排 capability 子 skill。**遇到以下任一情况就主动使用本 skill,不要自行写几行 pandas 就回答**:①用户出现触发词:Excel 分析 / 表格分析 / 数据分析 /
Open skill - /category-coloring
当Excel文件总行数超过1万行时,通过转换为Parquet格式提升读取性能,提取目标指标并计算最大值,最后将结果输出为Excel并对特定行进行高亮标注。
Open skill - /duplicate-value-coloring
对比Excel多表中的特定系数并对异常值进行颜色标记。
Open skill - /outlier-coloring
识别 Excel 中的超限数值与错误单元格并进行高亮标注。
Open skill - /threshold-cell-coloring
根据Excel总行数自动切换Parquet加速读取,计算特定维度的时间序列平均值,并使用openpyxl输出带有条件格式(如低于均值标绿)和自定义样式的分析报告。
Open skill - /top-value-coloring
根据数据规模动态选择处理策略,对多表数据进行合并、统计筛选,并利用 openpyxl 实现关键指标的自动化样式高亮与格式化导出。
Open skill

